Fast custom jackpot for Reactjs
- Support custom length
yarn add @acrool/react-jackpot
add in your index.tsx
import "@acrool/react-jackpot/dist/index.css";
then in your page
import {Flex, fr, Grid} from '@acrool/react-grid';
import styled from 'styled-components';
import {Jackpot} from '@acrool/react-jackpot';
import {generatorArray} from '@acrool/js-utils/array';
import {useRef} from "react";
const Example = () => {
const [amount, setAmount] = useState(32767);
const timeRef = useRef<Node.Timer>(null);
useEffect(() => {
timeRef = setInterval(() => {
onChange(getRandom(1000));
}, 3000);
return () => {
clearInterval(timeRef.current);
};
}, []);
return (
<Jackpot length={7} amount={amount}/>
);
export default Example;
There is also a example that you can play with it: