# SideToggle 예제

react-spring을 사용해서 자연스러운 애니메이션을 적용했다. 이때 toggle의 상태를 기억하는 과정에서 useRef의 객체 참조 기능과 이전 상태 기억 기능을 동시 에 사용한 예제이다.&#x20;

{% embed url="<https://medium.com/clever-franke/create-a-react-slidetoggle-component-with-hooks-and-react-spring-748919c38667>" %}

{% embed url="<https://codesandbox.io/s/9289n9wmjw?from-embed=&file=/src/index.js>" %}
