반응형
    
    
    
  
														Notice
														
												
											
												
												
													Recent Posts
													
											
												
												
													Recent Comments
													
											
												
												
													Link
													
											
									| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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 | 
													Tags
													
											
												
												- App
 - pandas
 - 딥러닝
 - 사이드프로젝트
 - JavaScript
 - React
 - Ros
 - redux
 - ReactNative
 - 클론코딩
 - 데이터분석
 - TeachagleMachine
 - 앱개발
 - 머신러닝
 - 카트폴
 - selenium
 - coding
 - 조코딩
 - 전국국밥
 - FirebaseV9
 - 강화학습
 - GYM
 - expo
 - Reinforcement Learning
 - kaggle
 - 리액트네이티브
 - 강화학습 기초
 - clone coding
 - Instagrame clone
 - python
 
													Archives
													
											
												
												- Today
 
- Total
 
qcoding
[ReactNative_study_4]Stack Navigator 본문
반응형
    
    
    
  1) Stack Navigator 종류
- Native stack navigator - nativa API 를 사용한다.
(IOS - uinAVIGATIONcONTROLLER / Android - Fragment )
약간의 커스텀이 제한된다. 그러나 Native를 사용하므로 성능이 좋음
- stack Navigator - React Navigation 에서 안드로이드 / IOS Look & feel 을 살리기 위하여 JavaScript로 만들어 것
커스텀에 자유도가 높음 그러나 성능이 좀 떨어질 수 있음
2) Navigation props의 종류 (https://reactnavigation.org/docs/navigation-prop)
- navigation
- navigate - go to another screen, figures out the action it needs to take to do it
 - reset - wipe the navigator state and replace it with a new route
 - goBack - close active screen and move back in the stack
 - setParams - make changes to route's params
 - dispatch - send an action object to update the navigation state
 - setOptions - update the screen's options
 - isFocused - check whether the screen is focused
 - addListener - subscribe to updates to events from the navigator
 
 
여러 종류의 props가 존재한다. 여기서 setOptions는 options을 변경해 주는 props로 아래의 screenOptions / options로 동일한 내용을 갖는다. (https://reactnavigation.org/docs/native-stack-navigator)
const Screen= ({navigation:{setOptions}})=> {return(
          <TouchableOpacity onPress={()=>{setOptions({title:"hello"})}}>
              <Text>Screen</Text>
          </TouchableOpacity>)}
// 여기서 <NvativStack.Navigator screenOptions={{}}/>는
// defalut로 모든 screen에 사용되며
// <NativeStack.Screen options={{}}/>는 각각의 screen에 적용되는 option이다.
* animation /presentation 같은 options도 있음. ios / android 기기에 따라 지원되는 옵션이 다르므로 확인을 해봐야한다.
screenOptions={{animation:"slide_from_left"}}
반응형
    
    
    
  'ReactNative' 카테고리의 다른 글
| [ReactNative_study_6]Theme Provider 사용하기 (0) | 2021.11.23 | 
|---|---|
| [ReactNative_study_5]Stack / Tab navigator 결합 (0) | 2021.11.23 | 
| [ReactNative_study_3] Navigator_Tabs / Color mode (0) | 2021.11.23 | 
| [ReactNative_study_2] 로딩 전 파일 불러오기 font/ asset (0) | 2021.11.22 | 
| [React Native study_1] Expo API <App_loading> (0) | 2021.11.22 | 
			  Comments