Issue by xareelee
Friday Apr 07, 2017 at 06:15 GMT
Originally opened as storybook-eol/storyshots#95
I upgraded React-Native from 0.42.0 to 0.43.2, and I encountered new test errors Invariant Violation: addComponentAsRefTo(...):
● Storyshots › [App] Root › entry
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 (details: https://fb.me/react-refs-must-have-owner).
at invariant (node_modules/fbjs/lib/invariant.js:44:15)
at Object.addComponentAsRefTo (node_modules/react-test-renderer/lib/ReactOwner.js:68:68)
at attachRef (node_modules/react-test-renderer/lib/ReactRef.js:23:16)
at Object.<anonymous>.ReactRef.attachRefs (node_modules/react-test-renderer/lib/ReactRef.js:42:5)
at ReactCompositeComponentWrapper.attachRefs (node_modules/react-test-renderer/lib/ReactReconciler.js:23:12)
at CallbackQueue.notifyAll (node_modules/react-test-renderer/lib/CallbackQueue.js:76:22)
at ReactTestReconcileTransaction.close (node_modules/react-test-renderer/lib/ReactTestReconcileTransaction.js:36:26)
at ReactTestReconcileTransaction.closeAll (node_modules/react-test-renderer/lib/Transaction.js:206:25)
at ReactTestReconcileTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:153:16)
at batchedMountComponentIntoNode (node_modules/react-test-renderer/lib/ReactTestMount.js:69:27)
I found that I have two version of react in my node_modules according to yarn.lock.
react@16.0.0-alpha.6:
version "16.0.0-alpha.6"
resolved "https://registry.yarnpkg.com/react/-/react-16.0.0-alpha.6.tgz#2ccb1afb4425ccc12f78a123a666f2e4c141adb9"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.1.0"
object-assign "^4.1.0"
react@^15.4.1:
version "15.4.2"
resolved "https://registry.yarnpkg.com/react/-/react-15.4.2.tgz#41f7991b26185392ba9bae96c8889e7e018397ef"
dependencies:
fbjs "^0.8.4"
loose-envify "^1.1.0"
object-assign "^4.1.0"
And I found only storyshots depends on react@^15.4.1:
storyshots@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/storyshots/-/storyshots-3.2.2.tgz#0e2027a86acc319f8100124224f0e3f09c29efc8"
dependencies:
babel-runtime "^6.20.0"
react "^15.4.1"
react-test-renderer "^15.3.1"
read-pkg-up "^2.0.0"
Is the dependency necessary? Or could you update the dependency to latest react (react@16.0.0)?
Friday Apr 07, 2017 at 06:15 GMT
Originally opened as storybook-eol/storyshots#95
I upgraded React-Native from 0.42.0 to 0.43.2, and I encountered new test errors
Invariant Violation: addComponentAsRefTo(...):I found that I have two version of
reactin mynode_modulesaccording toyarn.lock.And I found only storyshots depends on
react@^15.4.1:Is the dependency necessary? Or could you update the dependency to latest react (
react@16.0.0)?