logo

리액트 컴포넌트 드래그로 위치 이동하기 (react-use-gesture + react-spring)

language-logoReactJS
language-logoSpring

• react-use-gesture 라이브러리와 react-spring 애니메이션 라이브러리 설치
• useDrag 훅과 useSpring을 이용해 드래그 가능한 컴포넌트 구현
• 재사용 가능한 DragContainer 컴포넌트 생성
• 드래그 원하는 컴포넌트를 DragCont로 감싸서 위치 이동 구현

thumbnail
북마크
공유하기
신고하기
2분 분량
조회수 363
profile-image정수현
2년 전
Copyright © 2025. Codenary All Rights Reserved.