rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Remove navigation and navigationConfig from StackView, TabView

Open aksonov opened this issue 7 years ago • 2 comments

I propose each navigation view like StackView, TabView should declare needed input properties directly as Props: goBack (for StackView), navigate, tabBarComponent (for TabView) state, descriptors and remove generic dispatch (use direct methods like completeTransition instead of dispatch(NavigationActions.completeTransition()))

This way API for views will become easier to understand.

aksonov avatar Mar 09 '18 15:03 aksonov

So, the programming pattern of passing navigation to children that need to navigate will no longer work?

Just a side note but passing a subset as an object to said component is not the same navigation={{goBack, navigate, state}}, unlike navigation it will completely de-optimize PureComponent even when navigation state does not change.

dantman avatar Mar 09 '18 20:03 dantman

It's implemented like this in React Navigation 5 (i.e. there's no navigationConfig, just regular props). We haven't exported the views yet, but something we'll do soon after ensuring that the public APIs look good.

Regarding removing navigation object, I'm not too sure about it coz it does makes things a bit more complex. But probably ok.

satya164 avatar Sep 20 '19 00:09 satya164