Open
Description
Summary
The code example on "How does React know which state to return?" Deep Dive section in the "State: A Component's Memory" page is using the setState
function before defining it. While this code would work due to function hoisting in javascript, it's generally is not recommended, especially as it disturbs the reading flow for code snippets.
Page
https://react.dev/learn/state-a-components-memory#how-does-react-know-which-state-to-return
Details
No response
Activity