Skip to content

Commit

Permalink
Handle initialProps as optional in renderApplication
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rubennorte authored and facebook-github-bot committed May 7, 2020
1 parent e566c7e commit 26c120c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/ReactNative/renderApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function renderApplication<Props: Object>(
fabric={fabric}
showArchitectureIndicator={showArchitectureIndicator}
WrapperComponent={WrapperComponent}
initialProps={initialProps}
initialProps={initialProps ?? Object.freeze({})}
internal_excludeLogBox={isLogBox}>
<RootComponent {...initialProps} rootTag={rootTag} />
</AppContainer>
Expand Down

0 comments on commit 26c120c

Please sign in to comment.