Logister
Logister

Reputation: 1894

Hot reloading does not update changes

I have a react native app, right now when I make changes to it hot-reloading is triggered but the changes do not show up in the app. E.g. changing a background color from green to white in a stylesheet causes app to say "Hot Reloading" but then the color stays white. Fully reloading the app will then show the green background.

Things I have tried:

Setting root component to a class.

Removing yarn.lock

Reinstalling watchman

Trying to set MAX_WAIT_TIME (did not work due to solution being outdated)

Installing Babel Functional HMR

Running simulator via Xcode and react-native run-ios.

Running with only hot-reload, both hot-reload and live-reload, only live-reload. With and without remote-debugging.

System:
MacOS: 10.13.2
React-Native: 0.51.0
React-Native-Cli: 2.0.1
Xcode (for running the simulator): 9.2

What is going wrong here? How can I get hot-reloading to work?

EDIT:

Looks like this is an bug. Keeping this question open incase someone has a workaround.

Upvotes: 2

Views: 2745

Answers (3)

Praz Solver
Praz Solver

Reputation: 543

Try,

rm -rf /usr/local/var/run/watchman && npm uninstall watchman && npm install watchman

or

rm -rf /usr/local/var/run/watchman && brew uninstall watchman && brew install watchman

Then

react-native run-android

Upvotes: 0

Rob
Rob

Reputation: 1047

_# ###SOLUTION

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

OUTPUT will be : c:\Users\lenger\Desktop\webrowser>react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res Scanning folders for symlinks in c:\Users\lenger\Desktop\webrowser\node_modules (43ms) Scanning folders for symlinks in c:\Users\lenger\Desktop\webrowser\node_modules (38ms) Loading dependency graph, done. bundle: start bundle: finish bundle: Writing bundle output to: android/app/src/main/assets/index.android.bundle bundle: Done writing bundle output

and after

Run react-native run-android again, you will find your modification work.

Thanks to : [https://lengerrong.blogspot.am/2018/01/react-native-run-android-do-not.html][1]

Upvotes: 0

Logister
Logister

Reputation: 1894

Downgrading to react-native 0.48.4 solved the problem. Still not an optimal solution, so I won't mark this as the answer.

Upvotes: 1

Related Questions