Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Specify default params in the params key in route config #11

Merged
merged 6 commits into from
Oct 23, 2018

Conversation

brentvatne
Copy link
Member

export default createBottomTabNavigator(
  {
    A: {
      screen: Screen,
      params: { title: 'First One', icon: 'activity' },
    },
    B: {
      screen: Screen,
      params: { title: 'Second One', icon: 'aperture' },
    },
  },
  {
    tabBarOptions: {
      activeTintColor: '#000',
      inactiveTintColor: '#eee',
    },
  }
);

I went for the name params instead of defaultParams or initialParams because it's consistent with how we use navigationOptions in the routeConfig. I think it is clear to people that these are default params. If that doesn't turn out to be the case then we can adjust by renaming both navigationOptions and params in the route config object to something that implies default more strongly.

@brentvatne brentvatne merged commit 44852e5 into master Oct 23, 2018
@brentvatne brentvatne changed the title WIP: Specify default params in the params key in route config Specify default params in the params key in route config Oct 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant