Skip to content

Instantly share code, notes, and snippets.

@trueadm
Created October 18, 2017 14:48
Show Gist options
  • Save trueadm/b2493ac81681340b6dccf34ca84817e3 to your computer and use it in GitHub Desktop.
Save trueadm/b2493ac81681340b6dccf34ca84817e3 to your computer and use it in GitHub Desktop.
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