You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two mistakes in the ChatRoom example under the 'Preventing an Effect from firing too often' section:
The line const options = createOptions() suddenly appears in the code without context. It seems like this should be removed.
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:
The text was updated successfully, but these errors were encountered:
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:
const options = createOptions()
suddenly appears in the code without context. It seems like this should be removed.Screenshot of typo:
The text was updated successfully, but these errors were encountered: