Skip to content

Instantly share code, notes, and snippets.

@david90

david90/setParams.js

Created Jun 30, 2017
Embed
What would you like to do?
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
You can’t perform that action at this time.