<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 to300
.fps
— optional, number, target frames per second, defaults to30
.
withRenderInterval
HOC
Enhancer that injects renderInterval
prop into your component.
@withRenderInterval
decorator
Stateful component decorator that injects renderInterval
prop into your component.