nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

`replace()` should support deeply-nested navigators #261

Closed nandorojo closed 1 year ago

nandorojo commented 2 years ago

If you have tabs → stack → modal → another stack, the new isNestedNavigator field is insufficient since it only checks one layer deep for nested navigators.

There should be an alternative nestedNavigatorCount (or something like it) so that we know how deep the nested navigators need to go. Alternatively, there could be a behavior that is told to go as deep as possible vs a set number of layers:

replace('/', undefined, { nativeBehavior: 'stack-replace', nestedNavigatorBehavior: 'recursive' | 2 })

Setting recursive would tell Solito to go all the way to the root stack. Alternatively, you could tell it how many layers deep it should go with a number.

vinodsptharsha commented 1 year ago

Is this being considered for future release? I think it is a must have feature for majority of the apps involving complex routing systems.

nandorojo commented 1 year ago

Yes it is

nandorojo commented 1 year ago

will reopen this if i have time in the future to implement it.