Module '"../../../node_modules/react-native"' has no exported member 'View'

Module '"../../../node_modules/react-native"' has no exported member 'View'

If you have come across this error while working with react-native, it means that the module is unable to find the View component in the react-native package.

Possible Solutions:

  • 1. Check the import statement: Make sure that you have imported the View component correctly in your code. The import statement should look something like this:

import { View } from 'react-native';
  
  • 2. Check the version of react-native: This error can also occur if you are using an outdated version of react-native. Make sure that you have installed the latest version of react-native and its dependencies.

npm install react-native@latest
  
  • 3. Check if View is exported: Sometimes, this error can occur if the View component is not exported from the react-native package. In such cases, you can try to import the component directly from the source file:

import { View } from 'react-native/Libraries/Components/View/View';
  
  • 4. Check if the node_modules folder is present: Ensure that the node_modules folder is present in your project directory. If it is missing, run:

npm install
  

Hopefully, one of these solutions will solve the issue for you.

Subscribe to The Poor Coder | Algorithm Solutions

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe