0.2.0 • Published 5 years ago

react-lucky-box v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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>
    )
  }
}