diff --git a/releases/next/docs/navigation.html b/releases/next/docs/navigation.html index 6d5e14459b1..5b19ff92b63 100644 --- a/releases/next/docs/navigation.html +++ b/releases/next/docs/navigation.html @@ -83,7 +83,7 @@ const { <Text>This is a placeholder. We will come back to this and render our navigation here later.</Text> ); } -}
Alright, now we have a simple stateful component that doesn't do much at all. We can change that. Our initial state contains one route, and the current index. That looks suspiciously just like our initial route definition in Navigator. Do you remember which actions its navigator object provided?
Push and pop, of course. That seems pretty straightforward to implement. I promised you earlier we would be using reducers to manage state at the top-level object. Sit tight.
NavigationExperimental comes built-in with a some useful reducers, and they are all available as part of NavigationStateUtils. The two we will be using right now are called -- yep -- push and pop. They take a navigationState object, and return a new navigationState object.
We can use them to write our _onNavigationChange function which, given a "push" or "pop" action, will reduce the state accordingly.
Alright, now we have a simple stateful component that doesn't do much at all. We can change that. Our initial state contains one route, and the current index. That looks suspiciously just like our initial route definition in Navigator. Do you remember which actions its navigator object provided?
Push and pop, of course. That seems pretty straightforward to implement. I promised you earlier we would be using reducers to manage state at the top-level object. Sit tight.
NavigationExperimental comes built-in with some useful reducers, and they are all available as part of NavigationStateUtils. The two we will be using right now are called -- yep -- push and pop. They take a navigationState object, and return a new navigationState object.
We can use them to write our _onNavigationChange function which, given a "push" or "pop" action, will reduce the state accordingly.