a simple react component for count down
npm install react-count-down-view
import CountDownView from 'react-count-down-view'
<CountDownView name="count-first" second={10} trigger={onCountEnd} />
// 1: you should name your count view
// 2: set an int value 'second' for count number
// 3: set a 'trigger' func when count to end
<CountDownView name="count-two" second={4} trigger={onCountEnd} />
// you can set another counter named 'count-two'
// they will count in one 'setTimeout' callback
let CustomView = function(props) {
let { second, trigger } = props
return <div>{second}</div>
}
<CountDownView name="count-two" second={4} trigger={onCountEnd} view={CustomView}/>
// you can set your custom count view by set 'view' props