
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
Stacknavigation코드 밑에 BottomtapNavigation코드를 저렇게 붙여버리면 오류가 나는데 react native에서 navigation을 하나만 사용하는걸 권장하기 때문인가요?
Error: Creating a navigator doesn't take an argument. Maybe you are trying to use React Navigation 4 API? See https://reactnavigation.org/docs/hello-react-navigation for the latest API and guides., js engine: hermes
Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes
import React from "react";
import { createStackNavigator } from '@react-navigation/stack';
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
import MainPage from '../pages/MainPage';
import ProfilePage from '../pages/ProfilePage';
import SettingsPage from '../pages/SettingsPage';
const Routes = {
MainPage,
SettingsPage,
ProfilePage,
}
const Stack = createStackNavigator(Routes);
const BottomTab = createMaterialBottomTabNavigator();
export const Pagecut = () => {
return(
<Stack.Navigator>
<Stack.Screen name='MainPage' component={MainPage}
options={{
title: 'Roading...',
headerStyle: {
backgroundColor: '#fff',
},
headerTitleStyle:{
fontSize: 20,
fontWeight: '600',
}
}}/>
<Stack.Screen name='ProfilePage' component={ProfilePage}
options={{
title: 'profile',
headerStyle: {
backgroundColor: '#fff',
},
headerTitleStyle:{
fontSize: 20,
fontWeight: '600',
}
}}/>
</Stack.Navigator>
)
}
export const BottomTabPagecut = () => {
return(
<BottomTab.Navigator>
<BottomTab.Screen name="MainPage" component={MainPage}/>
<BottomTab.Screen name="SettingsPage" component={SettingsPage}/>
</BottomTab.Navigator>
)
}
