react-mathjax icon indicating copy to clipboard operation
react-mathjax copied to clipboard

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

Open andreperegrinah opened this issue 5 years ago • 7 comments

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.

andreperegrinah avatar Feb 27 '19 23:02 andreperegrinah

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

webMasterMrBin avatar Apr 04 '19 07:04 webMasterMrBin

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

mjyoung avatar Apr 10 '19 17:04 mjyoung

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

liu0fanyi avatar Apr 11 '19 03:04 liu0fanyi

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

webMasterMrBin avatar Apr 11 '19 03:04 webMasterMrBin

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 avatar Jul 29 '21 14:07 joshhales1

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.

joshhales1 avatar Aug 01 '21 07:08 joshhales1

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.

Martin-Eckleben avatar May 12 '22 13:05 Martin-Eckleben