Home > Enterprise >  What is the purpose of the flag --reset-cache in react-native start command
What is the purpose of the flag --reset-cache in react-native start command

Time:09-08

I am curious about this flag because since I've started building apps using react native I have been using it, without any clue what it really is.

CodePudding user response:

See when you do yarn start or npm start or react-native start

what it does is it starts the Metro bundler, builds a JS bundle , uses that in the app .

When you do yarn start --reset-cache or whatever command you use to start your app. it resets the JS bundle by bundling again.

So sometimes what happens is you add some code in JS layer and when debugging you cant see console.logs etc, but reset-cache ensures that latest JS bundle is taken :)

Hope it helps

You can see in the picture below, it says cache was reset enter image description here

  • Related