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]: Code example mistake in useMemo page #7252

Open
khkh0109 opened this issue Oct 24, 2024 · 2 comments
Open

[Typo]: Code example mistake in useMemo page #7252

khkh0109 opened this issue Oct 24, 2024 · 2 comments

Comments

@khkh0109
Copy link

Summary

There is a mistake in the ChatRoom example code on the useMemo page, specifically in the 'Preventing an Effect from firing too often' section.

Page

https://react.dev/reference/react/useMemo#preventing-an-effect-from-firing-too-often

Details

There are two mistakes in the ChatRoom example under the 'Preventing an Effect from firing too often' section:

  1. The line const options = createOptions() suddenly appears in the code without context. It seems like this should be removed.
  2. In the comment 'Only changes when createOptions changes', the reference to 'createOptions' should be replaced with 'options object'. This is because options is the actual dependency in the useEffect.

Screenshot of typo:
스크린샷 2024-10-24 오후 7 28 57

@JZZICK
Copy link

JZZICK commented Oct 29, 2024

Can i deal with this?

@JZZICK
Copy link

JZZICK commented Oct 30, 2024

#7261 has fixed

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

No branches or pull requests

2 participants