Commit 2f8d4f0
Ensure redbox shows up after reloads fail (#44959)
Summary:
Pull Request resolved: #44959
If a react instance create fails, ReactHost [calls handleHostException](https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=784-793%2C956-959%2C966%2C979-980%2C982%2C985-986). This method uses the dev support manager to show the redbox: line 789.
https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=784-793
But, if react instance reload fails, react host does everything in handleHostException, **except** call into dev support manager to show the redbox.
https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=457-466
Hence, the redbox doesn't show.
## Thoughts
These two code-paths do really similar things. I'm thinking about how to unify them.
Changelog: [Android][Fixed] Show RedBox after reloads fail (bridgeless)
Reviewed By: alanleedev
Differential Revision: D58592928
fbshipit-source-id: 37a7adc1845a8b28917fcd9acbaae1484478e4e61 parent ce2e426 commit 2f8d4f0
File tree
1 file changed
+6
-2
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime
1 file changed
+6
-2
lines changedLines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
461 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
462 | 466 | | |
463 | 467 | | |
464 | 468 | | |
| |||
0 commit comments