Uncaught Invariant Violation: addComponentAsRefTo(...):
See original GitHub issueAfter installation, I got this following error:
Uncaught Invariant Violation: addComponentAsRefTo(…): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component’s
render
method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
What’s that mean? What’s wrong with my installed package before?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:5
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Issues - GitHub
Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not...
Read more >Uncaught Invariant Violation: addComponentAsRefTo ...
I have tried uninstalling the package and reinstalling to no avail. Here is my code: render() { ... var _rows = []; for ......
Read more >`Error: Invariant Violation: addComponentAsRefTo(...): Only a ...
Coding example for the question Testing: `Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs.` error-Reactjs.
Read more >Refs Must Have Owner Warning - React
addComponentAsRefTo (…): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a...
Read more >ReactJS – Invariant Violation due to refs or multiple copies of React ...
“Uncaught Invariant Violation: addComponentAsRefTo(…): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created...
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
@hyunchulkwak, thanks for the workaround but I still get errors of peer dependency when I install with nested npm modules that is more than two levels.
Finally I found another solution for webpack. Just add an alias path of
react
topath.resolve('./node_modules/react')
to use common react for all npm modules required by webpack.Hope this helps~
Reference: http://stackoverflow.com/questions/31169760/how-to-avoid-react-loading-twice-with-webpack-when-developing
I get this issue, it seems that react color picker installs react in the node modules, not sure why since its set as a peer dependancy. Deleting the react folder in the color pickers node_modules folder seems to work, however, it breaks jenkins since it reinstalls the modules on every build.