This is the first example on the https://reactjs.org/hooks documentation: import {useState} from 'react' function Example() { // Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0) return ( <div> <p>You clicked {count} times</p> <button onClick={() ...

Learn about the massive improvements coming to function components in React via a fresh new course showing you how to refactor an existing app to these new and upcoming APIs. Ok, before I get into things, can I just say ...

Earlier this year, the React team introduced the first official context API. I blogged about that new API and people got sufficiently and reasonably hyped. One common complaint that I knew people were going to have when applying it practically ...

About a year ago, I published “How to give rendering control to users with prop getters”. In that post, I show the entire implementation (at the time) of react-toggled which I actually built for the sole purpose of teaching some ...

A few weeks ago I did a DevTips with Kent livestream where I show you how to refactor the compound components pattern from a class component to a function component with React hooks: If you’re unfamiliar with compound components, then ...