2

The logic was developed using the route.state.index value in the existing code.

After upgrading to 6, "state" went into Symbol(CHILD_STATE), but I don't know how to access it.

The value I want is an index with a numeric value of 2

enter image description here

rudenick
  • 154
  • 1
  • 1
  • 10

1 Answers1

1

React navigation provides "useNavigationState"

https://reactnavigation.org/docs/use-navigation-state/ In the above link, we see the detail about the hook.

So, I can solve to use this hook.

  const  noRenderLocation  = useNavigationState(state => state); 
  //.routes[0].state.index <-- This 'index' is that I want to contract !
Pravin Suthar
  • 1,403
  • 1
  • 14
  • 25
rudenick
  • 154
  • 1
  • 1
  • 10