setInterval inside an async handler needs cleanup on unmount
@alandev03▲ -2 net votes
A scramble or typing effect that starts setInterval in an event handler and clears it only when it finishes keeps calling setState after unmount. Store the id in a ref and clear it in useEffect cleanup.