Skip to content
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

Unhelpful error: "caught TypeError: Cannot read property 'refs' of null" #5841

Closed
m4nuC opened this issue Jan 13, 2016 · 4 comments
Closed
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@m4nuC
Copy link

m4nuC commented Jan 13, 2016

Adding a ref to a child element of a stateless component yields a caught TypeError: Cannot read property 'refs' of null. I can see this being really hard to debug. Could there be a better error message there ?

@jimfb
Copy link
Contributor

jimfb commented Jan 13, 2016

Duplicate of: #4939
Fixed in: #4943
Demo: http://jsfiddle.net/d0vvgssy/

@jimfb jimfb closed this as completed Jan 13, 2016
@jimfb jimfb reopened this Jan 13, 2016
@jimfb
Copy link
Contributor

jimfb commented Jan 13, 2016

Actually, I think I may have miss-read the issue. What is it you are trying to do? Can you provide a fiddle?

As far as I can tell, adding a ref to a child of a stateless component does work: http://jsfiddle.net/zxkfpx37/

@jimfb jimfb added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Jan 13, 2016
@m4nuC
Copy link
Author

m4nuC commented Jan 13, 2016

Actually you are right it behaves properly on fiddle. It must be something with my code. Thanks

@m4nuC m4nuC closed this as completed Jan 13, 2016
@jimfb
Copy link
Contributor

jimfb commented Jan 13, 2016

My fiddle is using a future/experimental version of React, so it's possible the issue was just fixed and not yet released. Either way, glad to hear it works in the latest fiddle!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants