커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
자꾸 개인 공부 질문만 하는 것 같습니다...하하
[왕초보] 나만의 수익성 앱, 앱개발 종합반 v5
기타
북마크
김*승
댓글
8
추천
0
조회수
19
조회수
19
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


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>

)

}


취소
 공유
취소
댓글 0
댓글 알림
나의얼굴