React native reload has no change solution: 1. Find the "app_name\node_modules\react-native\packager" directory; 2. Set "varMAX_WAIT_TIME =360000;"; 3. Find "_createWatcher(rootConfig)" , and modify the content of "join('\n')))"; 4. Reload the project.
The operating environment of this tutorial: Windows 10 system, react18.0.0 version, Dell G3 computer.
react native reload What should I do if there is no change?
react-native reload page does not refresh problem
Perhaps you will encounter a very abnormal and annoying problem during the development of react-native , the page does not refresh when reloading after modifying the code. . .
I searched online and said that I should change app_name\node_modules\react-native\node_modules\node-haste\lib\FileWatcher\index.js, but I couldn’t find node-haste according to this path, but However, I found node-haste in the directory app_name\node_modules\react-native\packager, and then changed the code according to the instructions on the Internet.
First
// var MAX_WAIT_TIME = 120000; varMAX_WAIT_TIME =360000;
Then find _createWatcher(rootConfig)
_createWatcher(rootConfig) { constwatcher=newWatcherClass(rootConfig.dir, { glob: rootConfig.globs, dot:false, }); return newPromise((resolve, reject) => { constrejectTimeout=setTimeout( () => reject(newError([ 'Watcher took too long to load', 'Try running `watchman version` from your terminal', 'https://facebook.github.io/watchman/docs/troubleshooting.html', ].join('\n'))), //修改的地方 MAX_WAIT_TIME ); watcher.once('ready', () => { clearTimeout(rejectTimeout); resolve(watcher); }); }); }
After the modification, it is indeed possible to reload the project. I hope it will be useful to my friends!
Recommended learning: "react video tutorial"
The above is the detailed content of What should I do if there is no change in react native reload?. For more information, please follow other related articles on the PHP Chinese website!