Our React-baseed mobile app needs to change the page title after returning from a subpage. The initial title is set like this
static createRoute = (route: Route): Route => {
let result = { ...route };
result.title = (route.props as any).location.name as string;
return result;
}
mapStateToProps and render are called with the new location.name in their props, but I can't see how to then change the title that appears in the navigation bar of the app.
According to this answer I should use this.props.navigation but my props never has a 'navigation' property. It does have a 'route' but it's ready-only.