Skip to content

Commit

Permalink
added to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
arnthor3 committed Jul 29, 2016
1 parent 03fa646 commit 257f7af
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,35 @@ npm run coverage
### Delay
You can pass in a string or a number. This prop controls the delay time in ms.
This prop works for the children as well as the parent.
``` js
const delay = (
<ReactDelayRender delay="250">
<MyComponent delay="350" />
</ReactDelayRender>
);
```
You can also nest the delays
``` js
const delay = (
<ReactDelayRender delay="250">
<h1 delay="250">I am rendered after 0.5s</h1>
<ReactDelayRender delay="250">
<h1 delay="500">I am rendered after one second</h1>
</ReactDelayRender>
</ReactDelayRender>
);
```
### onFinishRender
A callback that is envoked when the first level of children has finished rendering - Note: this only works for the first level of children, if the component has nested ReactDelayRender then you will need to attach a callback to them as well if needed.
A callback that is envoked when the first level of children has finished rendering - Note: this only works for the first level of children, if the component has nested ReactDelayRender then you will need to attach a callback to them as well if needed.
``` js
const complexDelay = (
<ReactDelayRender onFinishRender="">

</ReactDelayRender>
);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-delay-render",
"version": "0.0.3",
"version": "0.0.4",
"description": "a component that delays the rendering of child components",
"main": "./lib/DelayRender.js",
"scripts": {
Expand Down

0 comments on commit 257f7af

Please sign in to comment.