Access and Modify a DOM Node with the React useRef and useEffect Hooks
VanillaTilt we need to get access to a
div so that it can work its magic.
To make this happen we'll learn about React's
- Creating a reference to a DOM node with
- Making a callback function using
VanillaTiltto that DOM node
- Returning a cleanup function to avoid memory leaks
useEffectwith a dependency list to prevent rerendering.