React's useEffect hook is a super hook to run side effects. The hook comes with a cleanup function, which you might not always need, but it can come in handy. Some use-cases for this are to clean up subscriptions, clean up modals and clear timeouts.
19 Comments
Sort: