refs is null
See original GitHub issueI’m not sure if this is related to #4 but it seems React has a problem accessing refs when using a Gateway (i think this occurs on unmount - no error appears until after I’ve loaded then unloaded the view which adds the modal). Here’s my code:
https://gist.github.com/MarkMurphy/781e49b0d5a1e6b8218d
This component is based on the react bootstrap modal example found here: https://github.com/facebook/react/blob/master/examples/jquery-bootstrap/js/app.js
The specific error message is:
Uncaught TypeError: Cannot read property 'refs' of null
Full stacktrace is here
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React ref.current is null - Stack Overflow
I'm working on an agenda/calendar app with a variable time range. To display a line for the current time and show blocks for...
Read more >Ref returns undefined or null in React [Solved] | bobbyhadz
A React `ref` most commonly returns `undefined` or `null` when we try to access its `current` property before its corresponding DOM element is...
Read more >Refs are set to null instead of undefined when components ...
As a workaround, you can do a loose comparison (pretty common for null): ref == null -> true for undefined and null ......
Read more >The Beginners Guide to Template Refs - LearnVue
The ref has a default value of null and will actually be the value of the input once our component is mounted.
Read more >Template Refs - Vue.js
Note that you can only access the ref after the component is mounted. If you try to access $refs.input input in a template...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t know that this is a fixable one without a change in React as Gateway messes with the owner.
A work around is to use a wrapper component:
Maybe this is something that react-gateway can just do.
Hi, any updates on this? I get null even when using ref callback.