react-navigation / rfcs

RFCs for changes to React Navigation
Other
88 stars 16 forks source link

Remove navigation and navigationConfig from StackView, TabView #29

Open aksonov opened 6 years ago

aksonov commented 6 years ago

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.

dantman commented 6 years ago

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.

satya164 commented 4 years ago

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.