-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NavigationExperimental] Best way to dynamically change content of overlay from scene? #8350
Comments
It would be overkill to use Also, NavigationAnimatedView is deprecated. As for NavigationTransitioner, That means you can just pass in a 🍺 |
I've used Redux before, but haven't needed it yet since I started using Relay, but I think it's the time to use it together with Redux. |
or you can also use an event emitter like the way exnavigation does: |
I will close this as recommended solutions make sense. |
How can I make a reference to the header from my navRoot? I have this now.
` _renderHeader(props){
) When I try to do a function on the header from my navroot component I get an error in my application. this.headerconsoleLog is not a function. Header component code snippets ` class Header extends Component {
} consoleLog(){ |
@jmurzy What can I do to reference my header in e.g. my scenes? I can't find examples for this. I need to send scrollY positions to my header component to do animation. |
@jmurzy - I am still battling on how to change the overlay from a scene. What I would like to do is change the buttons and title from some of my view components created in the renderScene function. Have you built the sample you mentioned above so we see how this is supposed to work? |
I want to control / update content of
overlay
from thescene
component.For example, I want to dynamically change nav bar title based on user interactions inside a
scene
without doing any navigation.Afaik, the following is a simplified version of how
scene
andoverlay
are rendered inside aAnimatedView
orCardStack
.Correct me if I am wrong, but currently, it seems the only way to trigger rerendering of
overlay
from thescene
is to updatenavigationState
.That means we need to use a
reducer
to create a newnavigationState
, which will cause rerendering ofscene
as well asoverlay
.It sounds like an overkill and too heavy work for such a trivial task.
Another way I can think of is to expose a new API via
context
that can overrideoverlayProps
.Here's a simplified code snippet for the concept:
I can help with PR if you think this is a good idea.
What are your thoughts on this?
The text was updated successfully, but these errors were encountered: