From 730619dabfce369c574f395b3d938fe04b52537c Mon Sep 17 00:00:00 2001 From: Sunny Gurnani Date: Thu, 30 Jun 2016 17:54:50 -0700 Subject: [PATCH] BugFix: Title should be from scene.route.title Summary: Its a minor Bug fix for rendering Title in NavigationHeader Closes https://github.com/facebook/react-native/pull/8437 Differential Revision: D3507319 Pulled By: ericvicenti fbshipit-source-id: ff4aa36be3c4991be11aabecbaad952c015a60e2 --- .../NavigationExperimental/NavigationHeader.js | 3 +-- Libraries/NavigationExperimental/NavigationTypeDefinition.js | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js b/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js index 5603f0677..39a449b43 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js @@ -85,8 +85,7 @@ class NavigationHeader extends React.Component { static defaultProps = { renderTitleComponent: (props: SubViewProps) => { - const {navigationState} = props; - const title = String(navigationState.title || ''); + const title = String(props.scene.route.title || ''); return {title}; }, diff --git a/Libraries/NavigationExperimental/NavigationTypeDefinition.js b/Libraries/NavigationExperimental/NavigationTypeDefinition.js index dd4d9020b..1c106a543 100644 --- a/Libraries/NavigationExperimental/NavigationTypeDefinition.js +++ b/Libraries/NavigationExperimental/NavigationTypeDefinition.js @@ -23,6 +23,7 @@ export type NavigationGestureDirection = 'horizontal' | 'vertical'; export type NavigationRoute = { key: string, + title?: string }; export type NavigationState = {