react-lucky-box
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

React Lucky Box

Draw lots from React prop

npm version license code style: prettier

Example

Go to live example or

Edit react-lucky-box-example

Install

npm install react-lucky-box --save

Example

import React, { Component } from 'react'
import LuckyBox from 'react-lucky-box'

const lots = ['apple', 'banana', 'lemon']

class App extends Component {
  render() {
    return (
      <LuckyBox lots={lots}>
        {
          ({ lot, draw }) => (
            <div>
              <div>You got {lot}</div>
              <button onClick={() => draw()}>Redraw</button>
            </div>
          )
        }
      </LuckyBox>
    )
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-lucky-box

Weekly Downloads

4

Version

0.2.0

License

MIT

Unpacked Size

6.02 kB

Total Files

5

Last publish

Collaborators

  • cettoana