react.dev
react.dev copied to clipboard
The React documentation website
### Summary The React documentation states that mutating state is "not recommended" and that developers can "get away with it," when in fact mutating state doesn't trigger re-renders at all....
Explain why directly mutating objects in state is bad and add a short code example showing immutable updates. Fixes readability for beginners.
I have some questions about purity in React that I couldn’t find answers to in the docs. It would be helpful if the docs clarified these points and/or someone answered...
This PR improves code quality by removing unnecessary debug logging and enhancing TypeScript type safety in the codebase. Changes - Remove build-time console.log statements from compileMDX.ts that were logging cache...
[preview: useEffect reference docs ](https://react-5wbg1cutd-fbopensource.vercel.app/reference/react/useEffect#parameters) I had two instances recently where people were confused by useEffect not running after each render (https://github.com/facebook/react/issues/35221 and https://github.com/facebook/react/issues/34730). I think the docs aren't super...
"Counter example" has a specific meaning. Reworded the language to clarify that it points to the example about counter state variable. 
Closes #8158 Fix incorrect startTransition usage in docs The example in the Server Functions page calls a server action inside startTransition, but the state updates after the await aren’t wrapped...
https://react.dev/reference/rsc/server-functions#server-functions-with-actions 1. Shouldn't setError and setName need to be wrapped with a new startTransition? 2. It seems meaningless to apply startTransition to await updateName in the document, doesn't it? https://react.dev/reference/react/useTransition#react-doesnt-treat-my-state-update-after-await-as-a-transition