Skip to content
the poor coder

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

Poor Man
Published
Reading time
1 min read

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:
JavaScript

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.
JavaScript

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:
JavaScript

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:
JavaScript

npm install
  

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

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC