
React 19: `use` vs `useContext`, what changes and when to pick each
React 19's new use() API overlaps with useContext but breaks the Rules of Hooks on purpose. Here's how they differ, with examples for context and promises.
7posts

React 19's new use() API overlaps with useContext but breaks the Rules of Hooks on purpose. Here's how they differ, with examples for context and promises.

Let's look at a few examples of how React 19's new useActionState and useFormStatus hooks work

How to correctly handle event handlers in React, including events on window like resize and scroll, avoiding the most common mistakes.

A practical guide to React's useReducer hook: how it works, when to prefer it over useState, and a complete example for managing complex state.

How the useContext hook works in React to share data between components without props drilling, with a practical step-by-step example.

The most common mistakes to avoid when using React hooks: conditional calls, order, nested functions, and how to recognize them.

How to combine useContext and useState in React to share state and its update function between components, with a live example.