-
Notifications
You must be signed in to change notification settings - Fork 46.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
null owner in addComponentAsRefTo hard to fix #5631
Comments
I have exactly the same problem and can not get my head around it. The weird thing is that it seems to be related with the build setup. It works fine in my development setup but it fails with the above problems when built on Jenkins and running in a Docker container. |
Typically this means you have two Reacts bundled on the page: #2402 Try checking whether you're having This situation will be better if you ask the maintainer of that package to specify React as a I also wrote about this problem here. |
thanx @gaearon for your seemingly endless patience in responding to these problems. In my case it was caused by outdated modules on the Jenkins build. I only called 'npm install' for every build, instead of cleaning first. There was probably a module somewhere in the tree still depending on react 0.13 which was not updated because of lazy requirements. Btw, the link on medium gives a 404. |
That happens! Believe me, |
Issue appears to be that user had a duplicate copy of React, as mentioned in the URL given in the warning (https://fb.me/react-refs-must-have-owner). No comments for 7 days, closing. |
That's kind of harsh to close for a week of inactivity at the end of the holiday week ^^, especially since there was no comment to which to answer (I knew I might have multiple react, I asked for a reliable way to find out). |
We are always happy to reopen if this points to a legitimate bug. Unfortunately your post didn't offer any specific instructions to reproduce so it is not actionable. Closing non-actionable issues helps put focus on the issues that are actionable. If you find that the issue was not caused by a duplicate React, please let us know, and provide a way to reproduce.
I usually grep the build output for Thanks for publishing details of your investigation! |
I know it's been a while since this was closed, but I'm running into this null owner issue and it's breaking my application. Already verified that there aren't two Reacts loaded via:
All of those verified that there's only one React in my application. I've also gone through the entire component tree and refactored things such that all of the components down to the one rendering After finding out on StackOverflow that I can check the owner property on It seemed odd that |
Please file an issue with a minimal example that reproduces it. |
I am migrating my UI from react-1.13.3 to 1.14.3 and encountered the following error messages when loading my page:
I tried to fix it but I still have it with the following simple component:
So clearly my ref is set in the
render
method in this code that fails.I investigated about the possibility of having twice React loaded and
npm ls|grep react@
has only one line. I am not sure this proves anything since we have a complex build that generates our code (and probably the issue is somewhere in our build), but I ensured React code is only once in our output script, I also put a breakpoint in ReactCurrentOwner line 20 and was hit only once. I don't know if this is sufficient but for me we load React only once, so I went deeper.When debugging I see that in the call to
addComponentAsRefTo: function (component, ref, owner)
,owner
isnull
. I then put breakpoints whenReactCurrentOwner.current
is set to a non null value (ReactCompositeComponent lines 146 and 605, ReactMultiChild line 196 and 211). When I start my application, the breakpoint in ReactCompositeComponent:146 is hit twice (and at this time, this._currentElement.props is{hint:'root}
but each time it is reset to null on line 150. The call to addComponentAsRefTo is done outside these two windows where the owner is not null.What can I do to investigate more?
The text was updated successfully, but these errors were encountered: