cheapsteak / react-transition-group-plus

A more full-featured transition group for React
Other
268 stars 20 forks source link

Only a ReactOwner can have refs. #27

Closed quorak closed 6 years ago

quorak commented 6 years ago

This Error happens with react 15.6.2 and latest react-transition-group-plus

invariant.js:42 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 (details: https://fb.me/react-refs-must-have-owner).
    at invariant (invariant.js:42)
    at Object.addComponentAsRefTo (ReactOwner.js:68)
    at attachRef (ReactRef.js:23)
    at Object../node_modules/react-dom/lib/ReactRef.js.ReactRef.attachRefs (ReactRef.js:42)
    at ReactCompositeComponentWrapper.attachRefs (ReactReconciler.js:23)
    at CallbackQueue.notifyAll (CallbackQueue.js:76)
    at ReactReconcileTransaction.close (ReactReconcileTransaction.js:80)
    at ReactReconcileTransaction.closeAll (Transaction.js:209)
    at ReactReconcileTransaction.perform (Transaction.js:156)
    at ReactUpdatesFlushTransaction.perform (Transaction.js:143)
cheapsteak commented 6 years ago

Thanks for the bug report! Would you mind creating a reproduction at https://codesandbox.io ?

cheapsteak commented 6 years ago

I just ported the project's example over to codesandbox using react 15.6.2 Was not able to reproduce the error - https://codesandbox.io/s/rrz0j0470n , closing this ticket for now :)

I wonder if it might be worth checking out this article to see if it's being used correctly :)