react-interval-rerender

render props component that rerenders its children at regular intervals

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-interval-rerender
1.1.02 years ago6 years agoMinified + gzip package size for react-interval-rerender in KB

Readme

react-interval-rerender
CircleCI Coverage Status semantic-release Commitizen friendly npm version
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.