[RN] react-native tab navigation 스크린 이동 새로고침

2024. 8. 28. 16:40·React Native
반응형

🐰: tab2에서 하위 네비게이션으로 페이지를 이동했다가

tab3를 갔다가 tab2를 왔을때 tab2의 하위페이지가 아닌 메인페이로 새로고침이 되길 원했다 !

방법은 아주 간단했다 !

 

 

options={{ unmountOnBlur: true }}  추가

<Tab.Screen 
name="BaseBallLifetNavigation" 

//unmountOnBlur를 사용해주면 된다!!!!
options={{ tabBarLabel: 'tab2', headerShown: false, unmountOnBlur: true }} 

component={BaseBallLifeNavigation} />

 

unmountOnBlur: true옵션이 추가된 탭은 새로고침이 발생한다.

 

반응형

'React Native' 카테고리의 다른 글

[RN] react-native 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: number.' 에러잡기  (2) 2024.09.13
[RN] react-native button으로 sort 정렬하기  (0) 2024.09.06
[RN] react-native navigation params 사용하기  (0) 2024.08.28
[RN] reanimated failed to create a worklet react native.. error  (0) 2024.08.23
[RN] react-native UseEffect (()=> {},[]); 사용법  (0) 2024.06.25
'React Native' 카테고리의 다른 글
  • [RN] react-native 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: number.' 에러잡기
  • [RN] react-native button으로 sort 정렬하기
  • [RN] react-native navigation params 사용하기
  • [RN] reanimated failed to create a worklet react native.. error
nicee
nicee
답을 찾아가는 과정이 즐거운 프론트엔드 개발자의 기록모음🧐
    반응형
  • nicee
    나의 개발일지
    nicee
  • 글쓰기 관리
  • 전체
    오늘
    어제
    • 분류 전체보기
      • Project01 [Chat App]
      • React Native
      • Git
      • Program Setting
      • nicee-day
      • Study
        • C++
  • 블로그 메뉴

    • 링크

      • 🌳 git키우기
      • 📚 일상기록
    • 공지사항

    • 인기 글

    • 태그

      백준코딩테스트
      APP
      빌드에러
      typescript
      앱개발
      nextjs
      c++
      Android
      React
      k직장인
      에러해결
      티스토리챌린지
      IOS
      app build
      공부
      채팅앱
      Xcode
      오블완
      next.js
      리액트
      리액트네이티브
      React-native
      k직장인일상
      커피수혈
      불금
      firebase
      직장인짤
      rn
      타입스크립트
      error
    • 최근 댓글

    • 최근 글

    • hELLO· Designed By정상우.v4.10.0
    nicee
    [RN] react-native tab navigation 스크린 이동 새로고침
    상단으로

    티스토리툴바