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
Viewcomponent 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 ofreact-nativeand its dependencies.
npm install react-native@latest
- 3. Check if View is exported: Sometimes, this error can occur if the
Viewcomponent is not exported from thereact-nativepackage. 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_modulesfolder is present in your project directory. If it is missing, run:
npm install
Hopefully, one of these solutions will solve the issue for you.