ERROR Invariant Violation: requireNativeComponent: “RNSScreenStackHeaderConfig” was not found in the UIManager.

In React Native…

Aurora
ILLUMINATION

--

Photo by Luca Nicoletti on Unsplash

If you encountered this error while building your React Native project, fret not. Depending on the nature of your error, there is no one solution that solves all. However, you might want to try this solution —

Assuming that you are using VSCode to build your project, check that your Terminal states that you are currently in the correct directory of your project.

Solution —

After ensuring that you are in the right directory/folder of your project, look for the folder “node_modules”. Delete this whole folder. Stop metro by pressing “control c” on your macbook. Run this command —

yarn install 
npx react-native start
npx react-native run-ios

You will see that ‘node_modules’ folder has returned after running ‘yarn install’. ‘npx react-native start’ is to start metro. The error should have been resolved.

Photo by Alain Bouchard on Unsplash

--

--

Aurora
ILLUMINATION

⋆꙳•̩̩͙❅*̩̩͙‧͙ ‧͙*̩̩͙❆ ͙͛ ˚₊⋆