Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

brentvatne commented Oct 23, 2018

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 added 2 commits Oct 23, 2018
@brentvatne brentvatne merged commit 44852e5 into master Oct 23, 2018
3 checks passed
3 checks passed
ci/circleci: install-dependencies Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: unit-tests Your tests passed on CircleCI!
Details
@brentvatne brentvatne mentioned this pull request 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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.