react-native-navigation: update setTabBadge typings

According to docs the `badge` parameter to `setTabBadge` is mandatory
and can be set to `null` to remove the badge.
This commit is contained in:
Dan Homola
2018-03-22 10:29:22 +01:00
parent 55a1b5699f
commit 064ac3cc1e
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ export class Navigator {
toggleDrawer(params: { side: 'left' | 'right'; animated?: boolean; to?: 'open' | 'closed' }): void;
setDrawerEnabled(params: { side: 'left' | 'right'; enabled: boolean }): void;
toggleTabs(params: { to: 'hidden' | 'shown'; animated?: boolean }): void;
setTabBadge(params?: { tabIndex?: number; badge?: number; badgeColor?: string; }): void;
setTabBadge(params?: { tabIndex?: number; badge: number | null; badgeColor?: string; }): void;
setTabButton(params?: { tabIndex?: number; icon?: any; selectedIcon?: any; label?: string; }): void;
switchToTab(params?: { tabIndex?: number }): void;
toggleNavBar(params: { to: 'hidden' | 'shown'; animated?: boolean }): void;
@@ -11,6 +11,7 @@ class Screen1 extends React.Component<NavigationComponentProps & { height: numbe
componentDidMount() {
this.props.navigator.push({ screen: 'example.Screen2' });
this.props.navigator.setTabBadge({ badge: null });
}
render() {