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

In React Native, the error “invariant violation: requirenativecomponent: ‘rnsscreenstackheaderconfig’ was not found in the uimanager” usually occurs when there is an issue with the installation or linking of the react-native-screens library. This library provides a set of native navigation components for React Native apps.

To resolve this error, follow the steps below:

  1. First, make sure you have properly installed the react-native-screens library by running the following command in your project directory:

  2. yarn add react-native-screens

    or

    npm install react-native-screens

  3. After installing the library, you need to link it to your project. Run the following command:

  4. react-native link react-native-screens

  5. If the linking process fails or you are using React Native version 0.60 or above, you can try auto-linking instead:

  6. cd ios && pod install && cd ..

  7. After linking or auto-linking, rebuild your application by running the build command specific to your platform, for example:

  8. react-native run-android

    or

    react-native run-ios

If the error persists after following these steps, check the official documentation of react-native-screens for any additional installation or configuration instructions. Make sure you have the correct versions of React Native, react-native-screens, and related dependencies compatible with each other.

Here is an example of how the error message might look like in the terminal:


Invariant Violation: requireNativeComponent: 'RNSScreenStackHeaderConfig' was not found in the UIManager.

By following the suggested steps, you should be able to resolve the “invariant violation: requirenativecomponent” error and continue working with the react-native-screens library in your React Native app.

Similar post

Leave a comment