-
-
Save jhfgloria/0cda3d5d0e0399a55e5cf96a4b62c69f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyChildComponent extends PureComponent { | |
| render() { | |
| console.log('Proof that I\'m always re-rendering') | |
| // return something to render | |
| } | |
| } | |
| class MyParentComponent extends Component { | |
| componentDidMount() { | |
| window.setInterval(() => { | |
| this.forceUpdate | |
| }, 1000) // force the component to render every 1 second | |
| } | |
| render() { | |
| <MyChildComponent callback={ () => { console.log('Hello World') } } /> | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment