← React Intermediate Questions - Set 1 Q10

How do you handle side effects in functional components?

React Intermediate Questions - Set 1

Example

useEffect(() => {
  const id = setInterval(tick, 1000);
  return () => clearInterval(id);
}, []);

What to notice

← Back to the question list