'Does React Native production app contain devDependencies?

I faced the following issue https://github.com/callstack/react-native-testing-library/issues/955. Production build is failed and error points to the library from devDependencies.



Solution 1:[1]

Answer from Satyajit Sahoo on Reddit.

The app contains what you import. Doesn't matter if it's in dependencies, devDependencies or you just created a file. Those fields are to tell npm/Yarn about what to install. Bundling looks only at your imports.

If your bundle contains code from testing library`, then you're importing it into some file that's imported by your entry point.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dima Portenko