Skip to content

Latest commit

 

History

History
31 lines (17 loc) · 730 Bytes

RenderInterval.md

File metadata and controls

31 lines (17 loc) · 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.