mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
refactor: use named exports for navigators
This commit is contained in:
@@ -344,7 +344,7 @@ const navigation = useNavigation<FeedScreenNavigationProp>();
|
||||
It's also possible to type-check the navigator to some extent. To do this, we need to pass a generic when creating the navigator object:
|
||||
|
||||
```ts
|
||||
const Stack = StackNavigator<StackParamList>();
|
||||
const Stack = createStackNavigator<StackParamList>();
|
||||
```
|
||||
|
||||
And then we can use it:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { MaterialIcons } from '@expo/vector-icons';
|
||||
import createBottomTabNavigator from '@navigation-ex/bottom-tabs';
|
||||
import { createBottomTabNavigator } from '@navigation-ex/bottom-tabs';
|
||||
// @ts-ignore
|
||||
import TouchableBounce from 'react-native/Libraries/Components/Touchable/TouchableBounce';
|
||||
import Albums from '../Shared/Albums';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import createMaterialBottomTabNavigator from '@navigation-ex/material-bottom-tabs';
|
||||
import { createMaterialBottomTabNavigator } from '@navigation-ex/material-bottom-tabs';
|
||||
import Article from '../Shared/Article';
|
||||
import Albums from '../Shared/Albums';
|
||||
import Contacts from '../Shared/Contacts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import createMaterialTopTabNavigator from '@navigation-ex/material-top-tabs';
|
||||
import { createMaterialTopTabNavigator } from '@navigation-ex/material-top-tabs';
|
||||
import Albums from '../Shared/Albums';
|
||||
import Contacts from '../Shared/Contacts';
|
||||
import Chat from '../Shared/Chat';
|
||||
|
||||
@@ -2,7 +2,8 @@ import * as React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { Button } from 'react-native-paper';
|
||||
import { RouteProp, ParamListBase } from '@navigation-ex/core';
|
||||
import createStackNavigator, {
|
||||
import {
|
||||
createStackNavigator,
|
||||
StackNavigationProp,
|
||||
} from '@navigation-ex/stack';
|
||||
import Article from '../Shared/Article';
|
||||
|
||||
@@ -3,10 +3,12 @@ import { ScrollView, AsyncStorage, YellowBox } from 'react-native';
|
||||
import { Appbar, List } from 'react-native-paper';
|
||||
import { Asset } from 'expo-asset';
|
||||
import { NavigationContainer, InitialState } from '@navigation-ex/core';
|
||||
import createDrawerNavigator, {
|
||||
import {
|
||||
createDrawerNavigator,
|
||||
DrawerNavigationProp,
|
||||
} from '@navigation-ex/drawer';
|
||||
import createStackNavigator, {
|
||||
import {
|
||||
createStackNavigator,
|
||||
Assets as StackAssets,
|
||||
StackNavigationProp,
|
||||
} from '@navigation-ex/stack';
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* Navigators
|
||||
*/
|
||||
export { default } from './navigators/createMaterialTopTabNavigator';
|
||||
export {
|
||||
default as createMaterialTopTabNavigator,
|
||||
} from './navigators/createMaterialTopTabNavigator';
|
||||
|
||||
/**
|
||||
* Views
|
||||
|
||||
Reference in New Issue
Block a user