Permalink
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (17 sloc) 730 Bytes

<RenderInterval>

Same as <Render>, but uses setTimeout to re-render its children at a specified frame rate.

Usage

import {RenderInterval} from 'libreact/lib/RenderInterval';

<RenderInterval ms={1000} fps={25}>{({value}) =>
  <div>Value: {value}</div>
}</RenderInterval>

Props

  • ms — optional, number, time in milliseconds how long to re-render its children, defaults to 300.
  • fps — optional, number, target frames per second, defaults to 30.

withRenderInterval HOC

Enhancer that injects renderInterval prop into your component.

@withRenderInterval decorator

Stateful component decorator that injects renderInterval prop into your component.