React

Introduction to React - Useeffect() hook in React

23.

In which situation would you use the empty dependency array in the useEffect() hook?

When you want the effect to run only once, when the component mounts.

When you want the effect to run whenever the component updates.

When you want the effect to run based on a specific condition.

When you want the effect to never run.