Created
October 18, 2017 14:48
-
-
Save trueadm/b2493ac81681340b6dccf34ca84817e3 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 SomeComponent { | |
sayHello() { | |
console.log("Hello") | |
} | |
render() { | |
return <div>123</div> | |
} | |
} | |
class SomeParentComponent { | |
render() { | |
return ( | |
<div> | |
<SomeComponent ref={instance => this._instance = instance} /> | |
</div> | |
); | |
} | |
componentDidMount() { | |
// :( | |
this._instance.sayHello(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment