Uncaught Error: 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.
Got this error after upgrade gem to version 1.10.0. Old version (1.9.0) works correctly.
Are you adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded?
If you want to debug this, please share some info:
Then reopen this issue when you add that information!
try to remove the line //= require react-server from javascripts/component/server_rendering.js and see if it helps.
Hi @pan , it does work for me though I am no idea why. Thank you.
I ran into this same issue. While removing react-server from server_rendering.js does stop the error, it breaks server-side rendering.
Since mine also broke on an upgrade, I discovered that the real issue was due to using the legacy api for string refs. Figured I'd add this in case it helps anyone else.
@pan it does solve my issue. Thanks a lot.
Most helpful comment
try to remove the line
//= require react-serverfromjavascripts/component/server_rendering.jsand see if it helps.