question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React 17 Compatibility

See original GitHub issue

Hello, I’m new to React and React Native, so please bear with me if this a dumb question. I started a new project, which came with

"react": "17.0.1",
"react-native": "0.64.0"

and when I followed the official documentation on adding navigation, I ran the suggested command

npm install @react-navigation/native @react-navigation/stack

This command failed with

npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0" from @react-native-community/masked-view@0.1.10
npm ERR! node_modules/@react-native-community/masked-view
npm ERR!   peer @react-native-community/masked-view@">= 0.1.0" from @react-navigation/stack@5.14.3
npm ERR!   node_modules/@react-navigation/stack
npm ERR!     @react-navigation/stack@"*" from the root project

I then looked for react-native-community/masked-view, which led me to https://www.npmjs.com/package/@react-native-community/masked-view, where it says the package is at version 0.1.0. There was a link to a repo though - this one. Here, the latest release is v0.2.3, well above the 0.1.0. Coincidentally, this version claims to fix: peerDependencies support React 17.

There are two questions: Is @react-native-community/masked-view indeed the same thing as the @react-native-masked-view/masked-view from this repo? If so, why are the version numbers so different? Otherwise, why does the NPM page link here?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:27 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
symapcommented, Mar 29, 2021

I just installed all the React Navigation packages, including @react-native-community/masked-view (v0.1.10), using yarn instead of npm and it worked.

3reactions
jmkolbecommented, Mar 24, 2021

Thanks for your response. However, if one is not using masked-view directly, but via @react-navigation/stack, how does one resolve this dependency?

edit: to me it looks like @react-navigation/stack depends on @ react-native-community/masked-view

Read more comments on GitHub >

github_iconTop Results From Across the Web

React v17.0 – React Blog
React 17 supports the new JSX transform. We've also backported support for it to React 16.14.0, React 15.7.0, and 0.14.10. Note that it...
Read more >
Should I Upgrade to React 17? - JavaScript in Plain English
Long answer: React 17 will be the new standard and foundation for React. You can think of it as similar to Windows 10;...
Read more >
Upgrading to React 17 - Medium
Note: For this to work, both the version of React apps should be more than v17, which is why upgrading to v17 is...
Read more >
React 17 Compatibility - Material Design for Bootstrap
It kind of supports React 17. I asked a similar question here https://mdbootstrap.com/support/react/install-react-pro-5-0-1/. Using --legacy-peer-deps flag ...
Read more >
A new react release ... with no new features - Synergenie
React 17 offers a new, backward-compatible rewritten version of the JSX transform. Because of this, primarily, JSX can now be used without having...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found