Attempting to dynamically set the backButton title doesn't work. I am able to set other attributes of the topBar dynamically (like title), but backButton title doesn't update.
Here is how I reproduce:
export class Test extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
Navigation.mergeOptions(this.props.componentId, {
topBar: {
title: {text: 'foo'},
backButton: {
title: 'bar'
}
}
});
}
render() {
return <View/>;
}
}
Expected behavior: title updates to 'foo', backButton title updates to 'bar'.
Actual behavior: title updates to 'foo', backButton title doesn't update.
Have you tried it with static options() like this https://wix.github.io/react-native-navigation/#/docs/styling?id=styling-options
I have yes. It works correctly with static options.
static options(passProps) {
return {
topBar: {
backButton: {
title: 'foo'
}
}
};
}
It also works correctly if I pass the backButton title when pushing the screen. Unfortunately I need to update it dynamically while on the screen, which doesn't work. Thanks in advance!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
The issue has been closed for inactivity.
Confirmed this is still an issue with [email protected].
Confirmed this commit fixes it: https://github.com/wix/react-native-navigation/commit/84349384958ee9f0d03d24c6ef087cc5b7661d4b
Thanks!
I'm having this problem with version 2.8.0...
Navigation.mergeOptions(this.props.componentId, {
topBar: {
title: {text: 'foo'},
backButton: {
title: 'bar'
}
}
});
this does not update the back button title to "bar". I've tried setting showTitle to true but still see no change in the back button title. Other options like icon do work but I need the title to change.
I am also having this issue in 2.8.0 - backButton title does not override the topBar title
This still appears to be an issue, currently using 2.18.2
Most helpful comment
I have yes. It works correctly with static options.
It also works correctly if I pass the backButton title when pushing the screen. Unfortunately I need to update it dynamically while on the screen, which doesn't work. Thanks in advance!