Cleans your React Native project by purging caches and modules, and reinstalling them again.
yarn add -D react-native-clean-project
./node_modules/.bin/react-native-clean-project
This is a combination of the commands suggested in the React Native documentation plus others. They are:
watchman watch-del-all
rm -rf node_modules
rm -rf $TMPDIR/react-*
yarn cache clean
brew update
brew upgrade
yarn
Add to package.json
"scripts": { ... "purge": "./node_modules/.bin/react-native-clean-project", ... },
PR's welcome