Complete the code to import the React hook used for side effects.
import React, { [1] } from 'react';
The useEffect hook lets you perform side effects in React components.
Complete the code to add a side effect that logs 'Hello' once when the component mounts.
useEffect(() => { console.log('Hello'); }, [1]);An empty dependency array [] makes the effect run only once after the first render.
Fix the error in the effect that should update the document title when count changes.
useEffect(() => { document.title = `Count: ${count}`; }, [1]);The effect depends on count, so it must be in the dependency array to update correctly.
Fill both blanks to create two effects: one logs on mount, the other logs count changes.
useEffect(() => { console.log('Mounted'); }, [1]);
useEffect(() => { console.log(count); }, [2]);The first effect runs once on mount with an empty array. The second runs when count changes.
Fill all three blanks to create effects: one on mount, one on count change, and one on user change.
useEffect(() => { console.log('Start'); }, [1]);
useEffect(() => { console.log(count); }, [2]);
useEffect(() => { console.log(user); }, [3]);The first effect runs once on mount. The second runs when count changes. The third runs when user changes.