How to clear cache in a react-native project
Clearing out cache is another way if your project is not working. React-native project throws unknown bugs sometimes and it gets automatically fixed if you clear the cache.
How to clear cache:
It is simple. But before that, remove the node_modules folder and install it again.
rm -rf node_modules
npm i or yarn add
then start the server by restarting the cache:
npm start -- --reset-cache
yarn start --reset-cache
If it doesn’t work,
reset cache for react-native (if react-native cli is installed):
react-native start --reset-cache
For expo, use it:
expo start -c