React-modal: Error: Invariant Violation: addComponentAsRefTo

Created on 25 Oct 2015  路  15Comments  路  Source: reactjs/react-modal

Seeing this error in the latest 0.6.1:

Error: 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 

Anyone else having this issue?

bug needs info

All 15 comments

Same here.

+1

rm -rf node_modules && npm install solved the problem.

Yup @antoinerey that worked for me. Closing this issue.

Im having this problem too, reinstalling does not clear it

Also experiencing the same issue.

Hi, I'm using react 15.4.0 and react-modal 1.6.5, same thing here.
Removing and installing it anew doesn't change anything...

What is causing this ? Isn't there any fix ?

I'm having this issue when trying to run unit tests using mocha and enzyme. This issue makes it impossible to test components that use Modal.

Hi all, which versions of react-modal and react are you using? Later today I can have a look on this.
Can anyone write a reproducible example? codepen or other...

I'm reopening to gather more information.

I'm running 15.4.0 of react and 1.7.3 or react-modal.

@PonderingGrower can you try with an updated version of react-modal?

I can, but it will take a while because I would need to pull it into our internal packaging system to be able to use it first, and I'm pretty much done for today as it's Friday evening.

I can get back to you with an attempt with a newest version on Monday. Thanks for taking a look at this, cheers!

This issue must be fixed on current version v2+.

I'm closing this issue for clean up. Please, feel free to reopen this issue if needed.
Thank you!

This error with:
15.6.2 -react,
3.1.13 - react- modal

Was this page helpful?
0 / 5 - 0 ratings

Related issues

claydiffrient picture claydiffrient  路  4Comments

phaedryx picture phaedryx  路  4Comments

fabien-somnier picture fabien-somnier  路  3Comments

kinucris picture kinucris  路  3Comments

leoasis picture leoasis  路  4Comments