728x90 ๋ฐ์ํ Navigation3 [React Native] useNavigation์ useRoute ์ด์ฉํด์ ํ๋ฉด ์ด๋ํ๊ณ ๋ฐ์ดํฐ ์ ๋ฌํ๊ธฐ (Move and Pass data between two screens using Hooks) ์๋ ํ์ธ์ Foma ์ ๋๋ค. ํ์์ ๋ฆฌ์กํธ ๋ค์ดํฐ๋ธ์์ navigation์ props๋ก ์ ๋ฌํ๋ ๊ฒ ๋๋ฌด ๋ถํธํ๋๋ฐ์. ์ค๋์ React-Native์์ navigation์ props๋ก ์ ๋ฌํ๋ ๊ฒ์ด ์๋, useNavigation๊ณผ useRoute๋ฅผ ๋ง๋ค์ด ์ค์ ํ๋ฉด์ ์ด๋๊ณผ ํจ๊ป ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌํ๊ณ ๋ฐ์๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ๋ฐ๋ก ์์ํ ๊ฒ์~ Install npm install @react-navigation/native npm install @react-navigation/native-stack npm install @react-navigation/stack npm install react-native-safe-area-context Navigation Navigation/index.ts ๊ธฐ์กด Pro.. 2022. 8. 12. [React Native] Bottom-Tab ๋ง๋ค์ด ํ๋ฉด ์ด๋ํ๊ธฐ (Bottom-tab-navigator) ์๋ ํ์ธ์ Foma ์ ๋๋ค! ์ด๋ฒ์ ์ ๋ฒ Navigation์ ์ด์ฉํ์ฌ ์คํฌ๋ฆฐ ์ด๋ํ๊ธฐ ๊ธ์ ์ด์ด์ Bottom-tab์ ๋ง๋ค์ด ํ๋ฉด์ ์ด๋ํ๋ ๋ฐฉ๋ฒ์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค. (ํด๋น ์ฝ๋ ๊ธฐ๋ฐ์ผ๋ก ์งํ๋๊ธฐ ๋๋ฌธ์ ํน์ ์๋ณด์ ๋ถ๋ค์ ๋ณด๊ณ ์์ฃผ์ธ์!) ๋ฐ๋ก ์์ํ ๊ฒ์~ ์ธ์ด๋ TypeScript, ํ๊ฒฝ์ Expo๋ก ์งํ ํ๊ฒ ์ต๋๋ค! Install Bottom-tabs npm install @react-navigation/bottom-tabs Vector-icons npm install @expo/vector-icons index.tsx import ๋ฐํ ํญ์ ๋ง๋๋๋ฐ ํ์ํ ๋ชจ๋์ import ํด์ค๋๋ค. import { createNativeStackNavigator } from "@react-navigat.. 2022. 6. 16. [React Native] Navigation์ผ๋ก ํ๋ฉด ์ด๋ํ๊ธฐ (Navigation Between Screens) ์๋ ํ์ธ์ Foma ์ ๋๋ค! ์ค๋์ ๋ฆฌ์กํธ ๋ค์ดํฐ๋ธ์์ ๋ค๋น๊ฒ์ด์ ์ ์ฌ์ฉํ์ฌ ์คํฌ๋ฆฐ์ ์ด๋ํ๋ ๋ฐฉ๋ฒ์ ๋ํด ์์๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ๋ฐ๋ก ์์ํ ๊ฒ์~ ์ธ์ด๋ TypeScript, ํ๊ฒฝ์ Expo๋ก ์งํ ํ๊ฒ ์ต๋๋ค! Install Native npm install @react-navigation/native @react-navigation/native Native-stack npm install @react-navigation/native @react-navigation/native-stack Safe-area-context expo install react-native-screens react-native-safe-area-context Navigation Initial Setting App.tsx ์ด๊ธฐ .. 2022. 6. 16. ์ด์ 1 ๋ค์ 728x90 ๋ฐ์ํ