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