[TIL] ReactNative 특정 Warning 무시하기

햄스터아저씨·2021년 8월 28일
0

언젠가부터 아래와 같은 에러가 수십개씩 뜨기 시작했다.
%s: Calling %s on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release., ReactNativeFiberHostComponent, getNode()

분석 결과, react-native-reanimated 라이브러리가 2버전으로 업데이트 되었는데, react-native-draggable-flatlist 라이브러리에서는 1버전을 쓰고 있고 이 부분에 이슈가 생긴 것이었다.

하지만 react-native-draggable-flatlist 라이브러리가 이 문제를 빠르게 해결하지 못하여 warning은 계속 뜨고 있었고, 이 때문에 디버깅 및 오류분석에 시간이 더 걸려, 생산성이 나빠져가고 있었다.

결국 임시방편으로, 아래 코드를 이용하여 해당 로그를 무시하도록 처리하였다.

import { LogBox } from "react-native";
// LogBox.ignoreLogs(["Warning: ..."]);
LogBox.ignoreLogs([
  "ReactNativeFiberHostComponent: Calling getNode() on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release.",
]);

참고
https://github.com/computerjazz/react-native-draggable-flatlist/issues/277

profile
서버도 하고 웹도 하고 시스템이나 인프라나 네트워크나 그냥 다 함.

0개의 댓글