I need to read one value and use it to set title in navigation bar.
I am using react-native-router-flux
and I also use redux.
I navigate to view where I set language and fire redux action.
All views receive new state and in render()
method I can call:
console.log(this.props.language.language)
This is set through redux. And I want to change navigation bar title like:
Actions.refresh({title: I18n.t('main', {locale: this.props.language.language})})
But this slows down application and don't work.
But don't know where to put it if not in render
method.
You can change navigation title by setting navigation params as follows:
this.props.navigation.setParams({
title: 'YOUR_DESIRED_TITLE_HERE',
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With