-
Notifications
You must be signed in to change notification settings - Fork 51k
[DevTools Bug]: Console.log in second call to useMemo callback in strict mode is not dimmed or suppressed #27989
Copy link
Copy link
Closed
Labels
Component: Developer ToolsStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bugType: Bug
Description
Website or app
https://codesandbox.io/p/devbox/tender-aryabhata-xtrckf?file=%2Fapp%2Fpage.tsx
Repro steps
This only happens in the canary version of react. Most likely due to the changes made in #25583.
To repro:
- Enable strict mode
- Call console.log from inside a useMemo callback, e.g.:
useMemo(() => {
console.log("useMemo callback")
}, [])In React 18.2.0, the log from the second strict mode call to the useMemo callback will be dimmed or suppressed (depending on devtools settings). In React 18.3.0-canary-60a927d04-20240113 (or nextjs 14.0.4), both calls are logged normally.
Note: when using codesandbox to repro, look at the logs from the browser devtools console, not the embedded one in codesandbox, which doesn't always show the same output.
How often does this bug happen?
Every time
DevTools package (automated)
No response
DevTools version (automated)
No response
Error message (automated)
No response
Error call stack (automated)
No response
Error component stack (automated)
No response
GitHub query string (automated)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Component: Developer ToolsStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bugType: Bug
Type
Fields
Give feedbackNo fields configured for issues without a type.