wko27 / react-mathjax

MathJax as React component
MIT License
168 stars 71 forks source link

Element ref was specified as a string (node) but no owner was set. #11

Open andreperegrinah opened 5 years ago

andreperegrinah commented 5 years ago

I getting this error when I try to use the <MathJax.Node>

react-dom.development.js?cada:55 Uncaught Invariant Violation: Element ref was specified as a string (node) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded
See https://fb.me/react-refs-must-have-owner for more information.
webMasterMrBin commented 5 years ago

@andreperegrinah same problem with you
https://github.com/JedWatson/react-select/issues/2025 try this it workd

mjyoung commented 5 years ago

@webMasterMrBin What part of that linked issue worked for you?

liu0fanyi commented 5 years ago

@mjyoung I did this it was work rm -rf node_modules/react-mathjax2/node_modules/react this is why

webMasterMrBin commented 5 years ago

@mjyoung add this resolve: { alias: { 'react': path.resolve(__dirname, '../../node_modules', 'react') } } in my webpack.config.js

joshhales1 commented 3 years ago

Why is React included as a dependency if it causes issues?

I know this thread is old but this issue is still causing problems.

joshhales1 commented 3 years ago

This issue also makes deploying React apps to GitHub pages impossible. This really needs to be fixed. I'm using my own fork (the PR) to fix it for now.

Martin-Eckleben commented 2 years ago

This issue also makes deploying React apps to GitHub pages impossible. This really needs to be fixed. I'm using my own fork (the PR) to fix it for now.

I do now too.