Draw lots from React prop
Go to live example or
npm install react-lucky-box --save
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>
)
}
}