mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix crash in RNTester when removing/developing tests (#23406)
Summary: Ensure that the current openExample (stored in AsyncStorage) exists in the module list. It's possible for the example to be missing if a test was removed & previously open in RNTester OR when actively developing RNTester tests & switching between branches [General] [Fixed] - Potential crash in RNTester when removing/developing test cases Pull Request resolved: https://github.com/facebook/react-native/pull/23406 Differential Revision: D14055695 Pulled By: cpojer fbshipit-source-id: 6cf00e097e934f7a342e7d210b6319e1cba142ca
This commit is contained in:
committed by
Facebook Github Bot
parent
36e026ee89
commit
da6a26548b
@@ -110,7 +110,7 @@ class RNTesterApp extends React.Component<Props, RNTesterNavigationState> {
|
||||
}
|
||||
if (this.state.openExample) {
|
||||
const Component = RNTesterList.Modules[this.state.openExample];
|
||||
if (Component.external) {
|
||||
if (Component && Component.external) {
|
||||
return <Component onExampleExit={this._handleBack} />;
|
||||
} else {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user