React-native: Changes is not updating

Created on 29 Jul 2016  路  11Comments  路  Source: facebook/react-native

Hi, I've been trouble with react-native, I start a new project with react-native init, install dependencies, all right without errors, but when i run my app with react-native run-android the app opens in my device but if I change any file, it's not refresh, not update, nothing changes, if i force to 'reload', the app is refreshed but my changes not appear, so i have to run run-android again for see my changes.

My node version is v4.4.7
react-native-cli: 1.0.0
react-native: 0.24.1

Thanks!

Ran Commands Locked

Most helpful comment

found "react-native/packager/react-packager/src/DependencyResolver/FileWatcher/index.js"
then change "const MAX_WAIT_TIME = 120000" to "const MAX_WAIT_TIME = 360000"

All 11 comments

I've changed this "index.js" and it worked....
"app_namenode_modulesreact-nativenode_modulesnode-hastelibFileWatcherindex.js "
var MAX_WAIT_TIME = 120000;==>>var MAX_WAIT_TIME = 360000;
Hope to help you

Hi @thiagoterleski,

Did you installed watchman as described in the Getting Started documentation ?

Watchman is uses to watch files and record when they change. It can also trigger actions (such as rebuilding assets) when matching files change.

Since you're trying to do a fresh react native project, the version of react native should be 0.30.0 instead of 0.24.1 ?

Hi @charpeni,

So, i'm using windows and i can't install watchman, my react native version is 0.30.

found "react-native/packager/react-packager/src/DependencyResolver/FileWatcher/index.js"
then change "const MAX_WAIT_TIME = 120000" to "const MAX_WAIT_TIME = 360000"

@facebook-github-bot label Icebox

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/changes-is-not-updating

ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

@facebook-github-bot close

@charpeni tells me to close this issue. If you think it should still be opened let us know why.

Please help me.
My stack:
node:9.2.0
npm:5.5.1
react-native-cli: 2.0.1
react-native: 0.51.0

This worked for me. I had same issue but solved exporting path

  1. echo 'export ANDROID_HOME=/Users/$USER/Library/Android/sdk' >> ~/.bash_profile
  2. echo 'export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools' >>~/.bash_profile
    then
  3. source ~/.bash_profile

I was having a similar issue. Updates to index.js in RN 0.52 didn't update on actual phone. Finally found that rm -rf node_modules && npm install

Was this page helpful?
0 / 5 - 0 ratings