Created
September 23, 2016 12:18
-
-
Save aykutyaman/8c6d9c5779ededef1dc5775a8c171df3 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 Child extends React.Component { | |
greeting() { | |
return 'hello world'; | |
} | |
} | |
class Parent extends React.Component { | |
render() { | |
return ( | |
<TheChild ref='foo' /> | |
) | |
} | |
componentDidMount() { | |
const bar = this.refs.foo.greeting(); | |
// bar is now 'hello world' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment