Function useCreateLottoBallList

  • A React hook that returns a memoized LottoBallListComponent. This is the primary way to create a configurable list of lotto balls. Using this hook prevents the component from being recreated on every render.

    Parameters

    Returns LottoBallListComponent

    A memoized LottoBallListComponent ready to be used.

    Example

    const MyComponent = () => {
    const lottoBallSrcConfig = { [BallType.SelfPick]: './ball.png', ... };
    const LottoBallList = useCreateLottoBallList(lottoBallSrcConfig);

    const balls = [{ value: 1, type: BallType.SelfPick }];

    return <LottoBallList ballList={balls} maximumPick={5} />;
    }

Generated using TypeDoc