Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible RN 0.43? #54

Closed
XavierColombel opened this issue Apr 4, 2017 · 13 comments
Closed

Not compatible RN 0.43? #54

XavierColombel opened this issue Apr 4, 2017 · 13 comments

Comments

@XavierColombel
Copy link

XavierColombel commented Apr 4, 2017

I've got these errors:

npm WARN react-addons-shallow-compare@15.5.0-alpha.0 requires a peer of react@^15.5.0 but none was installed.
npm WARN react-test-renderer@15.4.2 requires a peer of react@^15.4.2 but none was installed.

capture d ecran 2017-04-04 a 15 27 58

@bd-arc
Copy link
Contributor

bd-arc commented Apr 4, 2017

@XavierColombel That's because RN 0.43 uses React version ~16.0.0-alpha.3, while our plugin dependencies expect version 15.x.y. This latest version of React hasn't been documented yet, so I don't know if we should expect breaking changes.

Note that we haven't tested compatibility with RN 0.43 since it hasn't been officially released yet. My guess is that it should work flawlessly though. You should just ignore npm warnings, try the plugin, and get back to me if it doesn't work.

@bd-arc bd-arc closed this as completed Apr 4, 2017
@XavierColombel
Copy link
Author

XavierColombel commented Apr 4, 2017

@bd-arc Ok I see what you mean. I've created a brand new project and I've added react-native-snap-carousel only, in order to test it. It doesn't work with RN 0.43 (see the red screen) that has been officially released yesterday I think.

I think you can find more about addons here facebook/react#9207

@bd-arc bd-arc reopened this Apr 4, 2017
@bd-arc
Copy link
Contributor

bd-arc commented Apr 4, 2017

@XavierColombel Thanks for the link (you should edit it by the way, since it redirects to a 404 error page ;-). Here is what seems to be the plan for the shallow-compare addon:

Plan for 16: we won’t be releasing 16 for this package. Nevertheless version 15 should keep working indefinitely.

Still, I don't like that part:

Internal dependencies (will break in 16)

The issue is that react-addons-shallow-compare wasn't installed with our plugin, which probably has to do with those changes. We'll try to migrate to RN 0.43 and see what we can do about it.

@XavierColombel
Copy link
Author

@bd-arc I just updated the link! ;) Ok, so I wait for a RN 0.43 compatible version. Thanks for your help.

@gaearon
Copy link

gaearon commented Apr 4, 2017

Which version of react package are you using?

@XavierColombel
Copy link
Author

XavierColombel commented Apr 4, 2017

@gaearon With RN 0.43, by default:

"dependencies": {
    "react": "16.0.0-alpha.6",
    "react-native": "0.43.0"
}

@gaearon
Copy link

gaearon commented Apr 4, 2017

And which versions of addons?

@gaearon
Copy link

gaearon commented Apr 4, 2017

(Can you double check their package.json in node_modules please)

@bvaughn
Copy link

bvaughn commented Apr 4, 2017

Chiming in kind of late, but here's a bit more context:

As you've noticed, shallowCompare is no longer accessible from react/lib/shallowCompare for react v16+. Going forward the shallow-compare code has been moved into its own package (instead of just forwarding to react). This change was made in react-addons-shallow-compare@15.5.0-alpha.0.

We wanted to update the version of react used inside of react-native and so we needed to also update to a newer release of react-addons-shallow-compare. Unfortunately there was a peerDependencies in the alpha release I pinned to, which is why you're seeing that warning. (That has been corrected in the subsequent react-addons-shallow-compare@15.5.0 release.)

That being said, you shouldn't be seeing the reference to react/lib/shallowCompare from react-addons-shallow-compare in the error screenshot you attached- unless one of your plugins is not using react-addons-shallow-compare@15.5.0-alpha.0.

@bd-arc
Copy link
Contributor

bd-arc commented Apr 4, 2017

@bvaughn Thank you very much for the detailed information! I appreciate that. I'll make the necessary adjustments to our plugin.

Since shallowCompare has apparently been deprecated, would you recommend migrating to React.PureComponent instead?

@bvaughn
Copy link

bvaughn commented Apr 4, 2017

No problem! 😄

react-addons-shallow-compare should continue to work indefinitely, even though we don't plan any future releases of the add-on past version 15.5.0.

PureComponent is the recommended path going forward though. If you can easily switch, go for it!

@bd-arc
Copy link
Contributor

bd-arc commented Apr 5, 2017

@XavierColombel Issue should be resolved with version 2.1.1. Can you try and confirm?

@gaearon @bvaughn Thanks for your help with this matter ;)

@XavierColombel
Copy link
Author

@bd-arc You rock! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants