callstackincubator / rebolt-navigation

Fast and declarative router for Rebolt
https://rebolt-navigation.callstack.com/
MIT License
208 stars 11 forks source link

WIP: Add replace action to navigation and make navigation type more generic #125

Open fakenickels opened 6 years ago

fakenickels commented 6 years ago

Making navigation type more generic

navigation is now derived from the parametric type commonNavigation('a) so we can sure for instance the same header component across different StackNavigators.

let make = (~navigation: Rebolt.StackNavigator.commonNavigation('a), _children) => {
 ...component,
 render: _self => {
  <View>
   <BackButton onPress={(_) => navigation.pop()}>
 </View>
 }
}

navigation.replace(Config.route)

I moved around a couple of things to accommodate the replace action. Mainly they were

Missing

Add to the documentation

Let me know if I can improve anything else before merging