Skip to content

Instantly share code, notes, and snippets.

@david90
Created June 30, 2017 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david90/4421e7976c7726eb298cd61e1af9dad6 to your computer and use it in GitHub Desktop.
Save david90/4421e7976c7726eb298cd61e1af9dad6 to your computer and use it in GitHub Desktop.
Update the title by setParams
class UserPage extends React.Component {
static navigationOptions: {
header: ({state}) => ({
left: (<NavBarBackButton />),
title: (
<UserPageTitle
userName={state.params.userName}
profilePicUrl={state.params.profilePicUrl}
/>
),
right: (<UserPageRight />),
}),
};
updateNavBarTitle() {
this.props.navigation.setParams({
userName: 'Yin',
profilePicUrl: 'http://www.example.com/myProfilePic.png',
});
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment