Skip to content Skip to sidebar Skip to footer

Issue When Pushing New Route With Navigator

I'm having a strange behavior with Navigator. The first time I will call navigator.push(...), it will sometimes print the following warning: Warning: flattenChildren(...): two chil

Solution 1:

initialRouteStack is the stack you're giving the navigator to begin with. Normally you just pass an initialRoute, so you're stack will start with just that route.

But you were passing all the routes into the initialRouteStack, so when you navigated to another scene you were basically pushing components to the end of that stack which already contains that component. Hope this makes sense and clarifies things.

Post a Comment for "Issue When Pushing New Route With Navigator"