README
react-interval-rerender
Render props component that rerenders its children at regular intervals
This is not the same as react-interval
or
react-interval-renderer
.
Usage
npm install --save react-interval-rerender
import * as React from 'react'
import Interval from 'react-interval-rerender'
export const Clock = () => (
<Interval delay={1000}>{() => new Date().toLocaleTimeString()}</Interval>
)
Props
delay?: ?number
The delay for setInterval
. While !Number.isFinite(delay)
, no interval
will be set. Whenever delay
changes the interval will be reset.
children?: () => ?React.Node
Function to render the content. You can use this or render
.
children
takes priority.
render?: () => ?React.Node
Function to render the content. You can use this or children
.