mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 22:30:41 +08:00
feat: add a getComponent prop to lazily specify components
This commit is contained in:
@@ -127,8 +127,8 @@ const CompatStack = createCompatStackNavigator<
|
||||
StackNavigationProp<NestedStackParams>
|
||||
>(
|
||||
{
|
||||
Feed: FeedScreen,
|
||||
Article: ArticleScreen,
|
||||
Feed: { getScreen: () => FeedScreen },
|
||||
Article: { getScreen: () => ArticleScreen },
|
||||
},
|
||||
{ navigationOptions: { headerShown: false } }
|
||||
),
|
||||
|
||||
@@ -362,7 +362,7 @@ export default function App() {
|
||||
<Stack.Screen
|
||||
key={name}
|
||||
name={name}
|
||||
component={SCREENS[name].component}
|
||||
getComponent={() => SCREENS[name].component}
|
||||
options={{ title: SCREENS[name].title }}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user