Skip to content

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

Open
@Issaminu

Description

@Issaminu

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

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions