Skip to content

Commit 26c120c

Browse files
rubennortefacebook-github-bot
authored andcommitted
Handle initialProps as optional in renderApplication
Summary: Pass a default empty object to `AppContainer` if no `initialProps` were passed to `renderApplication`. This prevents issues on Android, where we do not pass a default empty `initialProps` from native, as we do on iOS. Changelog: [General] [Fixed] - Handle nullish `initialProps` correctly in `renderApplication` Reviewed By: motiz88 Differential Revision: D21448692 fbshipit-source-id: 9630bdc2414532999abf3bf9da25047f0482fcab
1 parent e566c7e commit 26c120c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/ReactNative/renderApplication.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function renderApplication<Props: Object>(
4141
fabric={fabric}
4242
showArchitectureIndicator={showArchitectureIndicator}
4343
WrapperComponent={WrapperComponent}
44-
initialProps={initialProps}
44+
initialProps={initialProps ?? Object.freeze({})}
4545
internal_excludeLogBox={isLogBox}>
4646
<RootComponent {...initialProps} rootTag={rootTag} />
4747
</AppContainer>

0 commit comments

Comments
 (0)