
useState lazy initialization and function updates
When to pass a function to useState and setState
92 articles by Kent C. Dodds.

When to pass a function to useState and setState

What problems can happen when you use && to conditionally render content in JSX

How React is all you need to manage your application state

How to simplify your React apps by handling React errors effectively with react-error-boundary

What JavaScript features you should be familiar with when learning and using React

The build/dev tools and scripts I use for Node backends.

My silver bullet answer to this frequently posed question, and how to get started

Test-Driven Development doesn't always make sense, here's when it does for me.

The dangers of DRY, the web of WET, the awesomeness of AHA.

My process for making high value-to-minute content.

How to prioritize tests relative to everything else.

Why you shouldn't mock fetch or your API Client in your tests and what to do instead.

A challenge and ideas for you to do something to build your career.

How to manipulate stack traces to get beautiful error messages with Jest and your test helper functions.

How to use the (EXPERIMENTAL) interactions tracing API in React.

How you can use a few simple static code analysis tools to avoid common programming bugs.

Some mistakes I frequently see people making with React Testing Library.

The most simple React setup imaginable

Why you should stop using client-side route redirects (like the `from` prop on React Router's Redirect component) and what you should do instead.

A pattern for you to use in custom hooks to enhance the power and flexibility of your hooks.

When I prefer to use function declarations instead of arrow functions

Axios can do a ton of stuff, but here's a simpler solution that can handle most use cases

Get confidence your custom React hooks work properly with solid tests.

How to set up performance monitoring for production React applications.

Two built-in React hooks that handle state, which one should you use?

Why using a status enum (or even better: a **state machine**) will help your app stay bug free

If you're not careful you can write a test that's worse than having no tests at all

How creating DevTools specific for your own app can improve your productivity

Why it can be worth spending 1 hour automating a 10 second task

There are a few reasons you're getting this warning. Here's how you fix it.

All major browsers support ESModules now. Here's how to get started using them.

Let's write a state machine abstraction together to understand it better