I am using react-native-router-flux and I am also using redux.
I Navigate to the place where I view my language settings and fire redux actions.
All views receive the new state, in the render() method I can call:
console.log(this.props.language.language)
This is set through redux.
I want to change the title of the navigation bar, such as:
< pre>Actions.refresh({title: I18n.t(‘main’, {locale: this.props.language.language})})
But this will slow down the application and will not work .
But if it is not in the rendering method, I don’t know where to put it.
Instead, you should put it in a lifecycle method:
componentDidMount () {
Actions.refresh(...)
}
This trigger will be triggered when the component is installed for the first time.
< /div>
I need to read a value and use it to set the title in the navigation bar.
I am using react-native-router-flux and I am also using redux.
I navigate To see where I set the language and fire redux action.
All views receive the new state, in the render() method I can call:
console .log(this.props.language.language)
This is set through redux.
I want to change the title of the navigation bar, such as:
Actions.refresh({title: I18n.t('main', {locale: this.props.lan guage.language})))
But this will slow down the application and will not work.
But if it is not in the rendering method, I don’t know where to put it.
You should not modify the state in the rendering method-this will cause an infinite loop of changing state resulting in re-rendering.
Instead, you should put it In a life cycle method:
componentDidMount () {
Actions.refresh(...)
}
First time This trigger will be triggered when the component is installed.
WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5957 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC