에러 내용
Warning: Function components cannot be given refs.
Attempts to access this ref will fail.
Did you mean to use React.forwardRef()?
Check the render method of `StrictPanel`.
in JSXStyle (created by StrictPanel)
in StrictPanel (created by Flicking)
in div (created by Flicking)
in div (created by Flicking)
시도
- 기존 팀원이 작성했듯이 forwardRef를 추가한다.
- 근데 팀원은 왜? 무슨 근거로 이를 추가했을까?
- 팀원이 작성한 forwardRef를 제거한다.
- 에러가 두 개로 늘어났다.
- 그래서 다시 추가하면 하나로 줄어든다.
- 어딘가 빼놓은 게 있는 것 같으니 그걸 찾아본다.
- 갑자기 해당 library의 github issues를 뒤져보았다.
해결
- forwardRef 대신 useFindDOMNode를 사용하여 해결!
- 하지만 아래와 같은 새로운 에러가?!
- 이거 해결하러 다시 가즈아~
