Weird Expo behavior automatically changes files

In my React Native Expo App there are few things I have to change in the node-modules folder to make my app work correctly.

For example I change the AppEntry.js file to select the navigator file as a start file for my app wich works great. Also I have to adjust the metro-bundler blacklist.js - wich also doesnt cause any problems.

But when I restart/rebuild the app it seems like every change I made is discarded and put back to default… Is this normal?

Is there a way we can persist the settings - because it gets annoying having to change this on every start. Yesterday I spend 3 hours finding a fixx and after I finally found one and installed a new package so I had to restart the app again the errors appeared again and I didnt know why but now I know…

(if you want to answer on StackOverflow: https://stackoverflow.com/questions/61792088/expo-keeps-on-changing-files)

Hi

You should never have to edit stuff in node_modules. Of course you might feel forced to do that because of some bug, but in general you should avoid this and find a better way to fix the problem.

Could you instead have a more or less empty App.js that imports from “the navigator file” and re-exports it? Or could you rename your “navigator file” to App.js?

For this, I believe you should rather “Customize Metro”.

By the way, I don’t think expo start changes stuff in node_modules, or I would be very surprised if it did, but yarn or npm (or expo install) would.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.