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 257f7af commit 3130203
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,21 @@ const delay = (
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="">

const parentDone = () => {
console.log('Hello from parent,
called after mycomponent renders');
};

const childDone = () => {
console.log('Hello from child, called when the complexDelay has rendered');
};

const complexDelay = (
<ReactDelayRender onFinishRender={parentDone}>
<MyComponent delay="250">...</MyComponent>
<ReactDelayRender onFinishRender={childDone}>
<h2 delay="500"></h2>
</ReactDelayRender>
</ReactDelayRender>
);

0 comments on commit 3130203

Please sign in to comment.