일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- cyworld
- 스탠실 버퍼 사용
- c++ 정보은닉
- 리액트 네이티브 맥
- react native typescript navigate
- 스탠실 버퍼 시작
- CSS
- html
- 스탠실 버퍼 튜토리얼
- react native mac
- stencil buffer
- react native 타입스크립트
- GitHub
- react native ios 기기 연결
- react
- javascript
- Expo
- react native accessible
- 싸이월드
- react native
- unity stencil buffer
- react native typescript
- react native typescript navigation
- 벡터와 리스트의 차이
- node.js
- C++
- node
- 리액트 네이티브 설치 오류
- c++ using
- react-native
- Today
- Total
혀니의 이거저거 뿌시기
createDrawerNavigator (react navigation draw)이용해 옆 메뉴 만들기 (+ animated node with id 2 already exists 오류 해결) 본문
createDrawerNavigator (react navigation draw)이용해 옆 메뉴 만들기 (+ animated node with id 2 already exists 오류 해결)
혀니리리 2022. 4. 5. 19:23결과물
Drawer Navigator | React Navigation
https://reactnavigation.org/docs/drawer-navigator/
reactnavigation.org
기본적으로 옆 메뉴를 만드려면 react navigation drawer 모듈을 깔아야하는데 그러기위해선 이것만 깔야아하는게 아님
위 페이지에 나와있는
yarn add @react-navigation/drawer
yarn add react-native-gesture-handler react-native-reanimated
이런거 깔아야하는데 이거만 깔았다고 다가 아니라 react-nativation-reanimated는 요구하는게 더 있음.
Installation | React Native Reanimated (swmansion.com)
Installation | React Native Reanimated
Installing Reanimated requires a couple of additional steps compared to installing most of the popular React Native packages.
docs.swmansion.com
여기를 보면 babel.config 나 android 내부 파일 내용들도 일부 수정을 해줘야함
이렇게하고 node 서버를 종료시킨 다음에 다시 npm run android해줌
import * as React from 'react';
import { Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
//import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
//import Ionicons from 'react-native-vector-icons/Ionicons';
import {createDrawerNavigator} from '@react-navigation/drawer';
function HomeScreen() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Home</Text>
</View>
);
}
function SettingsScreen() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Settings!</Text>
</View>
);
}
function MypageScreen() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Settings!</Text>
</View>
);
}
//const Tab = createBottomTabNavigator();
const Drawer = createDrawerNavigator();
export default function App() {
return (
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={HomeScreen}/>
<Drawer.Screen name="Setting" component={SettingsScreen}/>
<Drawer.Screen name="Mypage" component={MypageScreen}/>
</Drawer.Navigator>
</NavigationContainer>
);
}
(App.js)
이런 간단한 코드로 테스트해보면 동영상처럼 나온다.
진짜 죽일뻔... 모듈깔때 모든 모듈이 잘 깔렸는지, 어떤 부분에서부터 에러가 나는지 파악해서 그 모듈설정을 고치는것이 중요해보인다.
'FRONT > 리액트네이티브' 카테고리의 다른 글
react native 이미지 가로배열 (0) | 2022.04.17 |
---|---|
react Splash Screen(로딩화면) 구현하기 (0) | 2022.04.16 |
잘 깔리던 리액트 다시 깔았을때 오류범벅 정리 (0) | 2022.03.31 |
react native 에 react-native-firebase-mlkit 모듈 깔고 한글인식/글자인식 성공시키기(안드로이드) (0) | 2021.08.18 |
git pull/merge/fetch개념알기 [깃허브 협업] (0) | 2021.08.09 |