스와이퍼
·
nodebird
어쩌다보니 슬라이더 라이브러리를 사용하는데 스와이퍼를 사용하고 있다. 근데 문제가 생겼다... ref의 current 속성이 업데이트된 후에 네비게이션 객체에 해당 ref를 전달해야 하지만 업데이트 전에 전달되는 대참사가... 그레서 여기서는 우리의 만능 useEffect를 이용해서 작업을 완성했다... 코드로만 보여주자면 const navigationPrevRef = useRef(null); const navigationNextRef = useRef(null); const commonSwiperProps = { loop: true, navigation: { nextEl: navigationNextRef?.current, prevEl: navigationPrevRef?.current, }, }; useE..