2

Every time i make changes to my code, i have to do a npm cache clean to reflect the changes i made. Is there any permanent solution for this?

I already tried the solutions given in React native run-android do not updating modified code , but still it is temporary.

I also have enabled hot reloading and live reloading as well. But even if i had not done it, it should update changes when reloaded manually.

My emulator is Nexus 5X, API version 28, memory 2048 MB.
react-native-cli version: 2.0.1
react-native version: 0.59.3.
I'm using ubuntu 18.04 and the RAM capacity is 8gb.

5
  • did you enabled hot reloading? Commented Apr 9, 2019 at 12:57
  • read this developer documentation link : facebook.github.io/react-native/docs/debugging Commented Apr 9, 2019 at 13:02
  • @Vencovsky will it help?, as of me app caches on crash Commented Apr 9, 2019 at 13:02
  • @Vencovsky yes i did. But it does not update. Commented Apr 9, 2019 at 13:30
  • I was using VS code as my text editor. Then i switched to atom. Maybe the memory is overused. I'm not sure. But it worked fine for me on atom. Commented Apr 11, 2019 at 5:34

2 Answers 2

2

In my case when I disable debugging then it updates. So this is my solution.

in Chrome dev tools > Network > Disable cache Hope that shell work for you

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

1 Comment

This worked when other options to hard refresh did not. Unchecking keeps the new files too.
-2

'Cache-Control': 'no-cache'

put this line in headers part.

3 Comments

which header? Can you explain it a bit, because i am new to react-native
in api headers part are available.
@RAVIPRAKASH its question on react-native, and your answer is far from topic. API is emulator soft version, app caches without any request made, where it could be added as well as no html though

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.