Skip to content

Commit 5a5b212

Browse files
committed
implement a custom TabNavigator wrapper
1 parent c55b591 commit 5a5b212

File tree

1 file changed

+27
-0
lines changed
  • source/views/components/tabbed-view

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @flow
2+
3+
import {
4+
TabNavigator as TabNav,
5+
NavigationScreenRouteConfig,
6+
} from 'react-navigation'
7+
import * as c from '../colors'
8+
9+
type ComponentType = (
10+
screens: {[key: string]: NavigationScreenRouteConfig},
11+
options: any, // I don't know how to type this better…
12+
// the package provides a bunch of types… but it doesn't even use some
13+
// of them??? and none seem to be the combination of args to the second
14+
// arg of TabNavigator.
15+
) => TabNav
16+
17+
export const TabNavigator: ComponentType = (screens, options) => TabNav(
18+
screens,
19+
{
20+
tabBarOptions: {
21+
activeTintColor: c.mandarin,
22+
backBehavior: 'none',
23+
...(options.tabBarOptions || {}),
24+
},
25+
...options,
26+
},
27+
)

0 commit comments

Comments
 (0)