2

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.

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

_# ###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]

Comments

0

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

1 Comment

what are your arguments for posting that answer ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.