Home > Web Front-end > Front-end Q&A > What should I do if there is no change in react native reload?

What should I do if there is no change in react native reload?

藏色散人
Release: 2023-01-18 14:17:48
Original
1238 people have browsed it

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.

What should I do if there is no change in react native reload?

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;
Copy after login

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);
});
});
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template