-
-
Save jhfgloria/ed4a6ece48023e37f1b92f23d8b38446 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 MyParentComponent extends Component { | |
| constructor() { | |
| super() | |
| this.state = { | |
| somethingBoundToParent: 'How are you?' | |
| } | |
| this.onCallback = this.onCallback.bind(this) | |
| } | |
| onCallback(fromChildArg) { | |
| const { somethingBoundToParent } = this.state | |
| console.log(fromChildArg, somethingBoundToParent) | |
| } | |
| render() { | |
| <MyChildComponent callback={ this.onCallback } /> | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment