unable to resolve module react/jsx-runtime

Viewed 4170

enter image description here

"dependencies": { "@react-native-community/masked-view": "0.1.10", "@react-navigation/native": "^5.8.10", "@react-navigation/stack": "^5.12.8", "expo": "^44.0.1", "expo-status-bar": "~1.2.0", "react": "^16.13.1", "react-dom": "16.13.1", "react-native": "^0.64.3", "react-native-gesture-handler": "~2.1.0", "react-native-paper": "^4.11.1", "react-native-reanimated": "~2.3.1", "react-native-safe-area-context": "3.3.2", "react-native-screens": "~3.10.1", "react-native-status-bar-height": "^2.6.0", "react-native-web": "~0.13.12" },

2 Answers

React 17 introduce a new feature New JSX Transform. In short, JSX Transform can make you write react without import React from 'react'. However, the new feature is introduced in React 17 and supported for React 16.14.0, React 15.7.0. "react": "^16.13.1" is not compatible with the new feature, so you should upgrade your react version.

Reference
  1. Introducing the New JSX Transform

Updating your react version possibily can resolve your problem. Command line: npm install --save react@latest.

Related