loading...

re: Difficulties Encountered with React Hooks VIEW POST

TOP OF THREAD FULL DISCUSSION
re: How can I replicate the behavior of componentWillUnmount? It's important when the component subscribes to events when mounted.
 

Does returning a callback function for cleanup not work in your case?

useEffect(() => {
  // do something
  return () => yourCleanupHere()
})
 

Missed that feature, thanks for letting me know.

Code of Conduct Report abuse