Skip to content

acrool/acrool-react-jackpot

Repository files navigation

Acrool React Jackpot

Acrool React Jackpot Logo

Fast custom jackpot for Reactjs

NPM npm npm

npm downloads npm

Features

  • Support custom length

Install

yarn add @acrool/react-jackpot

Usage

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:

Play react-editext-example

License

MIT © Acrool & Imagine