React-select: (npm link) Element ref was specified as a string (value0) but no owner was set.

Created on 26 Nov 2017  路  6Comments  路  Source: JedWatson/react-select

@JedWatson I've used your plugin extensively, it's awesome and I've never really had a problem with it. Now I'm building a component library, using your plugin for my Select menu. Everything works fine if I import my component library from node modules, but if i use npm link {library} then I get the following error onChange:

Uncaught Error: Element ref was specified as a string (value0) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).
    at invariant (invariant.js:42)
    at coerceRef (react-dom.development.js:6736)
    at createChild (react-dom.development.js:6998)
    at reconcileChildrenArray (react-dom.development.js:7303)
    at reconcileChildFibers (react-dom.development.js:7672)
    at reconcileChildrenAtExpirationTime (react-dom.development.js:7780)
    at reconcileChildren (react-dom.development.js:7771)
    at updateFragment (react-dom.development.js:7808)
    at beginWork (react-dom.development.js:8273)
    at performUnitOfWork (react-dom.development.js:10244)
    at workLoop (react-dom.development.js:10308)
    at HTMLUnknownElement.callCallback (react-dom.development.js:540)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:579)
    at invokeGuardedCallback (react-dom.development.js:436)
    at renderRoot (react-dom.development.js:10386)
    at performWorkOnRoot (react-dom.development.js:11000)
    at performWork (react-dom.development.js:10952)
    at batchedUpdates (react-dom.development.js:11070)
    at batchedUpdates (react-dom.development.js:2323)
    at dispatchEvent (react-dom.development.js:3414)

In Redux DevTools, I can see the value changing, and then immediately I get the @@redux-form/DESTROY action. I also have react-datetime and a few other plugins which are not having this issue when I use npm link

Most helpful comment

I have the same issue with only this plugin.

All 6 comments

Sounds like your bundling process is including two copies of react. Without seeing the setup, I can't say why (or why it may be different from the other libraries - there are several things that can cause it) but usually there's a way to work around it by specifying your external packages and bundling them separately.

This isn't specific to react-select, so maybe see if you can get advice on stack overflow or reactiflux. Good luck 馃憤

I have the same issue with only this plugin.

@JedWatson I also have the same problem with only this library. Specifically when I set the "value" prop as anything other than null/undefined, in a controlled component or not.

same issue...

A less than ideal but effective workaround I've found is to delete the node_modules/ directory from the linked package when testing the library in an app implementation.

same here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericj17 picture ericj17  路  3Comments

coder-guy22296 picture coder-guy22296  路  3Comments

mjuopperi picture mjuopperi  路  3Comments

pablote picture pablote  路  3Comments

sampatbadhe picture sampatbadhe  路  3Comments