Skip to content

Instantly share code, notes, and snippets.

@jhfgloria
Last active May 1, 2019 16:53
Show Gist options
  • Select an option

  • Save jhfgloria/633b2099cc1cdf6219b90dfe5073b78a to your computer and use it in GitHub Desktop.

Select an option

Save jhfgloria/633b2099cc1cdf6219b90dfe5073b78a to your computer and use it in GitHub Desktop.
class MyChildComponent extends PureComponent {
render() {
this.props.callback('Hello World')
console.log('Proof that I\'m always re-rendering')
// return something to render
}
}
class MyParentComponent extends Component {
render() {
<MyChildComponent callback={ (fromChildArg) => { console.log(fromChildArg) } } />
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment