Watch “Use a status enum instead of booleans” on egghead.io Watch “Handle HTTP Errors with React” on egghead.io (part of The Beginner’s Guide to ReactJS) Let’s play around with the Geolocation API a bit and learn about the perils of ...

Watch “When to useState instead of useReducer” on egghead.io Watch “When to useReducer instead of useState” on egghead.io Whenever there are two things to do the same thing, people inevitably ask: “When do I use one over the other?” There ...

If you’re using react@>=16.8, then you can use hooks and you’ve probably written several custom ones yourself. You may have wondered how to be confident that your hook continues to work over the lifetime of your application. And I’m not ...

A while ago, I developed a new pattern for enhancing your React components called the state reducer pattern. I used it in downshift to enable an awesome API for people who wanted to make changes to how downshift updates state ...

If you’ve been working with React for a while, you’ve probably used useState. Here’s a quick example of the API: function Counter() { const [count, setCount] = React.useState(0) const increment = () => setCount(count + 1) return <button onClick={increment}>{count}</button> } ...