Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

Navigation's headerTitle is fixed #122

Open
aloifolia opened this issue Aug 25, 2018 · 1 comment
Open

Navigation's headerTitle is fixed #122

aloifolia opened this issue Aug 25, 2018 · 1 comment

Comments

@aloifolia
Copy link

When I use Rebolt's stack navigation with navigation bars, I can initialize the title of the navigation by setting the property headerTitle of a screen component. The title then remains fixed to this initial value. If I want to have it changed dynamically, whenever some state in my app changes, the only "option" (this is not really an option) is to leave the screen and reopen it.

Usually the default behaviour is fine. However, if you implement a language switch inside the app, you will see that every screen on the stack (at the moment when the language is switched) keeps its title as long as it is alive.

Ultimately I have to restart the app to see any changes in the navigation bar for the start screen of the app.

baransu added a commit to baransu/rebolt-navigation that referenced this issue Sep 6, 2018
…Props

It allow us to check for header props changes and call navigation.setOptions when props changes. Should fix callstackincubator#122. Only problem are properties that are recreated every time like Style.t or (probably) Header.returnsComponent.
@baransu
Copy link

baransu commented Sep 6, 2018

Right now StackNavigator assigns header props in Screen's didMount lifecycle and ignores further changes. There is possibility to use retainedProps and update header in didUpdate lifecycle. #124 should fix that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants