react-navigation / rfcs

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

Modular Action Creators #18

Closed ericvicenti closed 6 years ago

brentvatne commented 6 years ago

@ericvicenti - we also spoke a bit about a convenience API for extending existing routers, eg:

StackNavigator({
  Home: HomeScreen,
  Other: OtherScreen,
}, {
  addActionsForRoute: route => ({
    goHome: () => ({ type: 'NAVIGATE', routeName: 'Home' }),
  }),
});
ericvicenti commented 6 years ago

Are there any objections to pushing this forward?

@brentvatne, did you want me to include addActionsForRoute in this proposal, or should we deal with it in a follow up? I think it makes a lot of sense

brentvatne commented 6 years ago

no objections!

@brentvatne, did you want me to include addActionsForRoute in this proposal, or should we deal with it in a follow up? I think it makes a lot of sense

seems like a good fit here, yeah!