react-count-down-view

1.0.3 • Public • Published

react-count-down-view

a simple react component for count down

Use

npm install react-count-down-view

Sample code

    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

Readme

Keywords

Package Sidebar

Install

npm i react-count-down-view

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

8.94 kB

Total Files

6

Last publish

Collaborators

  • qilei