mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 22:30:41 +08:00
[flow] Fix TabBar types (#5800)
1. `TabBarTop` is `MaterialTopTabBar` now 2. `MaterialTopTabBar` does not have a `getButtonComponent` prop (accidentally added in #5648) 3. `BottomTabBar`'s `getButtonComponent` prop is a `React.Component`, not a `React.Node`
This commit is contained in:
@@ -1184,7 +1184,7 @@ declare module 'react-navigation' {
|
||||
};
|
||||
declare export var TabView: React$ComponentType<_TabViewProps>;
|
||||
|
||||
declare type _TabBarTopProps = {
|
||||
declare type _MaterialTopTabBarProps = {
|
||||
activeTintColor: string,
|
||||
inactiveTintColor: string,
|
||||
showIcon: boolean,
|
||||
@@ -1205,12 +1205,20 @@ declare module 'react-navigation' {
|
||||
jumpToIndex: (index: number) => void,
|
||||
}) => void,
|
||||
renderIcon: (scene: TabScene) => React$Element<*>,
|
||||
getButtonComponent: (scene: TabScene) => React$Element<*>,
|
||||
labelStyle?: TextStyleProp,
|
||||
iconStyle?: ViewStyleProp,
|
||||
};
|
||||
declare export var TabBarTop: React$ComponentType<_TabBarTopProps>;
|
||||
declare export var MaterialTopTabBar: React$ComponentType<
|
||||
_MaterialTopTabBarProps
|
||||
>;
|
||||
|
||||
declare type _BottomTabBarButtonComponentProps = {
|
||||
onPress: () => void,
|
||||
onLongPress: () => void,
|
||||
testID: string,
|
||||
accessibilityLabel: string,
|
||||
style: ViewStyleProp,
|
||||
};
|
||||
declare type _BottomTabBarProps = {
|
||||
activeTintColor: string,
|
||||
activeBackgroundColor: string,
|
||||
@@ -1234,7 +1242,9 @@ declare module 'react-navigation' {
|
||||
}) => void,
|
||||
getTestIDProps: (scene: TabScene) => (scene: TabScene) => any,
|
||||
renderIcon: (scene: TabScene) => React$Node,
|
||||
getButtonComponent: (scene: TabScene) => React$Node,
|
||||
getButtonComponent: (
|
||||
scene: TabScene
|
||||
) => React$ComponentType<_BottomTabBarButtonComponentProps>,
|
||||
style?: ViewStyleProp,
|
||||
animateStyle?: ViewStyleProp,
|
||||
labelStyle?: TextStyleProp,
|
||||
|
||||
Reference in New Issue
Block a user