Very cool! I never knew that selection has so much cool stuff to fiddle around with.
A quick question: wouldn't you want to return an unsubscribe() function from the event listener in your useEffect() to clean up the listener when the component unmounts?
Thanks for the article :D
Noël Cserépy
I build animated web apps with NextJS and Framer Motion.
Very cool! I never knew that selection has so much cool stuff to fiddle around with.
A quick question: wouldn't you want to return an
unsubscribe()function from the event listener in youruseEffect()to clean up the listener when the component unmounts?Thanks for the article :D