-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to call child's method or child's refs? #1118
Comments
@frenzzy I've tried the suggestion, but it didnt work. It also returned the proxy component. |
Please explore the demo more carefully: https://jsfiddle.net/frenzzy/z9c46qtv/3/ |
@frenzzy The demo doesn't really help because I think it's problem caused by hot module reloading. |
This approach works fine with hot reload in master branch. P.S.: Added a tiny new section to React docs: When to Use Refs |
@joonhocho Did you resolve it? |
You have to call the function callChildMethod() of your parent component from inside render function. |
That's a horrible hack, sorry |
I want to call child method or reference to child's
refs
.It should work, but
refs.child
returnsProxyComponent
rather thanChild
. And, theProxyComponent
does not havemethod
norrefs.root
.I think this is due to having
hot module reloading
together withwithStyles
.Any ideas? I've tried with release mode as well, but to no avail.
Child.js
Parent.js
The text was updated successfully, but these errors were encountered: