Reloading the app with fast-refresh disabled does not work #11463
Labels
bug
Needs: Author Feedback
The issue/PR needs activity from its author (label drives bot activity)
no-recent-activity
Issue/PR has gone stale and may be closed (label applied by bot)
Scenario: Reload
Problem Description
The immediate problem here is that when fast refresh is disabled, reloading the app causes it to close instead of reload. Then you have to run 'npx react-native run-windows' again to get it restarted.
I would appreciate help finding a way to make developing an app manageable in addition to the immediate issue being fixed from someone with a better understanding of react-native + metro + react-native-windows:
I am targeting react native windows using clojurescript which is compiled to javascript. I am new to react-native but have been using clojurescript + react for a while.
Note that in the starter project with fast-refresh enabled:
I use clojurescript + shadow-cljs build tool to compile to ./app/index.js. It is from this file that the root component is registered. From the starter project's ./index.js, I import this file. Whenever the clojurescript is compiled to javascript (updating ./app/index.js), the app has to 'reload the bundle', so fast-refresh is not an option.
I noticed that the application will immediately and accurately update when app/index.js is changed even when fast-refresh is disabled... then it thinks it need to 'reload the bundle' and screws it up. So I thought that disabling fast-refresh would be the way to go and then I could manually reload the app whenever I needed a hard reload. This led me to the immediate issue I am reporting.
Steps To Reproduce
npx react-native init testProj --template react-native@^0.71.0
cd testProj
npx react-native-windows-init --overwrite --language cs
npx react-native run-windows
(open the developer menu and disable fast-refresh -- alternatively edit the App.xaml.cs ctor line InstanceSettings.UseFastRefresh = true to InstanceSettings.UseFastRefresh = false before building)
(press r in the metro terminal or press Reload App in the debugging tab)
Expected Results
the same thing that happens when you reload the app with fast-refresh enabled
CLI version
npx react-native -v
10.0.0
Environment
Target Platform Version
None
Target Device(s)
Desktop
Visual Studio Version
2022
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
The text was updated successfully, but these errors were encountered: