If you are an avid reader of content on websites like Medium.com or even here at Hashnode.com, you may have noticed this feature: This is a tooltip that appears when you select a portion of text on these websites. Today, we will recreate this same f...

Markdown supported · ⌘↵ to post
I got too excited it worked I forgot about cleanup. 🤦🏻 Thanks. I will update.
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