Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typo]: using function before creating it in example #7283

Open
Issaminu opened this issue Nov 9, 2024 · 0 comments · May be fixed by #7284
Open

[Typo]: using function before creating it in example #7283

Issaminu opened this issue Nov 9, 2024 · 0 comments · May be fixed by #7284

Comments

@Issaminu
Copy link

Issaminu commented Nov 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant