TILs From the Epic React Advanced Hooks Workshop :: rockyourcode
Here are some notes from the Epic React workshop Advanced Hooks. Function Dependencies in useEffect We use the useEffect hook to run side effects in React. The hook has a “dependency array” which tells it when to fire. That works fine if the trigger is a variable. Like this: const [count, setCount] = useState(0) React.useEffect(() = { // Update the document title using the browser API document.title = `You clicked ${count} times` }, [count]) //