TILs From the Epic React Advanced Hooks Workshop

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]) // <-- that's the dependency list What happens if we use a function as a trigger?
Read more →

4 TILS from the Epic React Basic React Hooks Workshop

What did I learn from the workshop Basic React Hooks by Kent C. Dodds? Previously, I wrote down my learnings from the React Fundamentals workshop. The second workshop introduces React hooks. Here are some insights that I found useful: Set Initial State Via Props Set an initial value by adding props to a component: <Greeting initialName="George"> Take that as an argument to the function and pass it down to useState:
Read more →

3 TILs from the Epic React Fundamentals Workshop

Kent C. Dodds released his Epic React training course with a big fanfare last week. I was on the fence of buying this, as the pro license is a premium training course that comes with a premium price tag. The course is expensive compared to other online courses. For example, a year-long-subscription to Frontend Masters costs roughly the same. But as a life-long learner, I’m dedicated to becoming a better programmer.
Read more →

Sign up for the newletter!

powered by Buttondown