Rules of React – React
Just as different programming languages have their own ways of expressing concepts, React has its own idioms — or rules — for how to express patterns in a way that is easy to understand and yields high-quality applications. To learn more about expressing UIs with React, we recommend reading Thinking in React. This section describes the rules you need to follow to write idiomatic React code. Writing idiomatic React code can help you write well organized, safe, and composable applications. These properties make your app more resilient to changes and makes it easier to work with other developers, libraries, and tools. These rules are known as the Rules of React. They are rules – and not just guidelines – in the sense that if they are broken, your app likely has bugs. Your code also becomes unidiomatic and harder to understand and reason about. We strongly recommend using Strict Mode alongside React’s ESLint plugin to help your codebase follow the Rules of React. By following the Rules of
API Reference Copy page Copy Rules of React Just as different programming languages have their own ways of expressing concepts, React has its own idioms — or rules — for how to express patterns in a way that is easy to understand and yields high-quality applications. Components and Hooks must be pure React calls Components and Hooks Rules of Hooks Note To learn more about expressing UIs with React, we recommend reading Thinking in React . This section describes the rules you need to follow to write idiomatic React code. Writing idiomatic React code can help you write well organized, safe, and
Explore this link on the map →related reading
- Keeping Components Pure – Reactreact.dev
- You Might Not Need an Effect – Reactreact.dev
- Blogged Answers: A (Mostly) Complete Guide to React Rendering Behavior · Mark's Dev Blogblog.isquaredsoftware.com
- Why React Re-Renders • Josh W. Comeaujoshwcomeau.com
- Understanding useMemo and useCallback • Josh W. Comeaujoshwcomeau.com
- Tao of React - Software Design, Architecture & Best Practices | Alex Kondovalexkondov.com
- Tutorial: Tic-Tac-Toe – Reactreactjs.org
- Introducing Hooks – Reactlegacy.reactjs.org
- React graph viscrubier.github.io
- Building Bulletproof React Components - Shu Dingshud.in
- Pure components in React: Using PureComponent and React.memo - LogRocket Blogblog.logrocket.com
- The Interactive Guide to Rendering in Reactui.dev