eiriklv / react-masonry-component

A React.js component for using @desandro's Masonry
MIT License
1.44k stars 145 forks source link

Element ref was specified as a string (masonryContainer) #98

Closed hurrtz closed 6 years ago

hurrtz commented 6 years ago

Hey guys,

I think there might be an issue with environments running React 16 and using masonrycomponent, which by itself runs React 15.

I get the error "Uncaught (in promise) Error: Element ref was specified as a string (masonryContainer) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner)." which is pretty brutal as this kills the entire app. React completely stops working.

Can you please look into this? The relevant parts in my package.json: "react": "^16.0.0" "react-dom": "^16.0.0" "react-masonry-component": "^5.0.7"

As soon as I have reverted React back to the version you have in your own package.json everything worked again.

afram commented 6 years ago

Yes you are right. This needs to be updated.

On 4 Oct 2017 12:55 pm, "Tobias Winkler" notifications@github.com wrote:

Hey guys,

I think there might be an issue with environments running React 16 and using masonrycomponent, which by itself runs React 15.

I get the error "Uncaught (in promise) Error: Element ref was specified as a string (masonryContainer) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner)." which is pretty brutal as this kills the entire app. React completely stops working.

Can you please look into this? The relevant parts in my package.json: "react": "^16.0.0" "react-dom": "^16.0.0" "react-masonry-component": "^5.0.7"

As soon as I have reverted React back to the version you have in your own package.json everything worked again.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eiriklv/react-masonry-component/issues/98, or mute the thread https://github.com/notifications/unsubscribe-auth/ACInFraVIsP9VI3OHv7k8KHT9ewze8vVks5so3JJgaJpZM4PtfqC .

afram commented 6 years ago

This should now be fixed in v6.0.0

Please let me know if it works for you.

Closing this ticket, though please open again if needed!

hurrtz commented 6 years ago

Just had my dependencies updated again and now everything is cool. Thanks, now I can finally use react 16 :)