airbnb / native-navigation

Native navigation library for React Native applications

Home Page:http://airbnb.io/native-navigation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Request] Get current state

braco opened this issue · comments

commented

It would be helpful to have something like

Navigator.status()

to retrieve the current Navigation state

Also, is there currently a way to retrieve the initial Route when reloading? It doesn't seem like onAppear/onEnterTransitionComplete events are fired. Don't know if that's a bug or by design.

I don't quite follow what you are asking? What do you mean by the current navigation state?

commented

Navigation stack and/or the current topmost component. The original reason I asked was to keep nav state visible on a toolbar. I guess since there are differentiations made in the type of component (presentation vs push), it would ideally represent that in the object. Maybe something like this?:

screen = { name, component, modals }
stack = [screen, screen, ...]