3

I'm currently using the react native navigation library. I'm having trouble debugging certain issues and I want to know :

  • how do you view the stack of screens that are currently pushed?
  • when you have cascading modals, how do you view their order and do the modal instances have a unique ID?
Coder Lam
  • 395
  • 1
  • 3
  • 13

1 Answers1

1

In case your are using react navigation with redux. You can locate them in the debugger tools which also gives you the order and the unique ID.enter image description here

something like this.

edit for your comment:

you can watch for state change in redux to determine the current screen. I guess there is no getCurrentScreen. React navigation provides callback for state change which you could use.

    onNavigationStateChange={(prevState, newState) => {
      // your code to determine screen
    })
Gaudam Thiyagarajan
  • 1,022
  • 9
  • 24