Invariant violation: requirenativecomponent: “rnsscreen” was not found in the uimanager.

The “Invariant Violation: requireNativeComponent: ‘RNSScreen’ was not found in the UIManager.” error occurs in React Native when the RNSScreen component from the React Navigation library is not properly installed or configured in your project.

To fix this issue, you need to ensure that you have installed the necessary dependencies and correctly linked the library to your project.

Here are the steps to resolve the error:

  1. Install the required packages. Open a terminal or command prompt, navigate to your project directory, and run the following commands:

    $ npm install react-navigation-stack
    $ npm install react-native-screens
    $ npm install react-native-gesture-handler
  2. Link the libraries to your project. Run the following command:

    $ react-native link react-native-screens
  3. If you are using React Native 0.60 or higher, the linking process should be automatic. However, if you are using an older version, you might need to manually link the libraries. In that case, follow the manual linking instructions provided by the official documentation of each library.

After completing these steps, rebuild your project and the error should be resolved. If you still encounter the same error, make sure you have properly followed the installation and configuration instructions provided by React Navigation and its related libraries.

Keep in mind that this error might also occur if you have multiple versions of React Navigation packages installed in your project. Make sure you have only one version installed to avoid any conflicts.

Read more

Leave a comment