Skip to content

Clarification on useCallback function name on beta docs #5079

Description

@kkyusufk

In the react beta docs, useCallback api reference page gives the following example
image

I think the constant naming memoizedFn leads to some confusion on what useCallback does.
People tend to assume that useCallback actually memoizes the function but it does not do that. It returns the same instance of the function between re-renders.
An appropriate name of that variable should be originalFn.
I maybe wrong so please let me know if the above makes sense.

Big fan of the beta docs btw ❤️ , beautiful documentation and excellent examples!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions