• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

아래 에러의 원인을 못찾겠네요 ,,,

22.03.09 17:22 작성 조회수 2.27k

0

https://github.com/dongguntechnology/rn_chat
 
 
17:20
Invariant Violation: "main" has not been registered. This can happen if: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project. * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
 
 
rror: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

답변 1

답변을 작성해보세요.

0

안녕하세요 shafeel2 님, 

  

https://github.com/dongguntechnology/rn_chat/blob/5b0849/screens/ChannelList.js#L61

Hook은 함수 컴포넌트 안에서 호출해야 합니다. 

참고: https://ko.reactjs.org/docs/hooks-rules.html

61line을 let channels = []; 로 변경하세요

  

즐거운 하루 되세요

감사합니다.