Warning: Error: Looks like you have nested a 'NavigationContainer' inside another.

예진·2024년 10월 23일
0

🚨 error collection

목록 보기
4/11

오늘의 오류

Warning: Error: Looks like you have nested a 'NavigationContainer' inside another. Normally you need only one container at the root of the app, so this was probably an error. If
this was intentional, pass 'independent={true}' explicitly. Note that this will make the child navigators disconnected from
the parent and you won't be able to navigate between them.

  • NavigationContainer가 안에 또있다! 고 하는 메시지다.
    배달앱 코딩하면서 중간에 한두페이지정도 전체복붙한 게 있었는데 그거 문젠가 하고 그냥 나중에봐야지~ npm 어쩌군가부지뭐 하고있었다.
    app안에 appInner를 넣어줬는데 둘 다 NavigationContainer가 있어서 그런갑다. 그래서
function App() {
  return (
    <Provider store={store}>
      <NavigationContainer>
        <AppInner /> // 얘안에도 NavigationContainer가 있다.
      </NavigationContainer>
    </Provider>
  );
}

지워줬다. 강의 보고했는데 왜 이러지 ^_^ 다시확인 해봐야겠다.

function App() {
  return (
    <Provider store={store}>
      <>
        <AppInner /> // 얘안에도 NavigationContainer가 있다.
      </>
    </Provider>
  );
}

0개의 댓글