Skip to content

Commit

Permalink
Remove unreachable if-condition in refresh logic (#45296)
Browse files Browse the repository at this point in the history
Summary:
The `hasUnrecoverableErrors` function has been [hardcoded](https://github.com/facebook/react/blob/f38c22b244086f62ae5ed851b6ed17029ec44be5/packages/react-refresh/src/ReactFreshRuntime.js#L602) to always return false for the past 5 years, since React Refresh [can recover from all errors](facebook/react#17438). This hardcoding was introduced in react-refresh v0.7.1, and RN currently uses v0.14.2.

## Changelog:

[INTERNAL] [REMOVED] - Remove unreachable if-condition in refresh logic

Pull Request resolved: #45296

Test Plan: Fast Refresh should still work as expected.

Reviewed By: NickGerleman

Differential Revision: D59405648

Pulled By: arushikesarwani94

fbshipit-source-id: 6fefedb484eeab032028d738b48ac936a9044cb0
  • Loading branch information
damianstasik authored and facebook-github-bot committed Jul 5, 2024
1 parent 820a884 commit 8c8c77b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/react-native/Libraries/Core/setUpReactRefresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ if (__DEV__) {
register: ReactRefreshRuntime.register,

performReactRefresh() {
if (ReactRefreshRuntime.hasUnrecoverableErrors()) {
DevSettings.reload('Fast Refresh - Unrecoverable');
return;
}
ReactRefreshRuntime.performReactRefresh();
DevSettings.onFastRefresh();
},
Expand Down

0 comments on commit 8c8c77b

Please sign in to comment.