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
{{ message }}
Repository navigation
[DevTools Bug]: Console.log in second call to useMemo callback in strict mode is not dimmed or suppressed #27989
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.
I tried to repro the error in vsode with React 18.3.0-canary-60a927d04-20240113, the log from the second strict mode call to the useMemo callback was grey(dimmed). So i found nothing wrong. May it only happends on Nextjs 14.0.4
Activity
Nathan-Roberts123 commentedon Jan 27, 2024
I tried to repro the error in vsode with React 18.3.0-canary-60a927d04-20240113, the log from the second strict mode call to the useMemo callback was grey(dimmed). So i found nothing wrong. May it only happends on Nextjs 14.0.4
russelldavis commentedon Jan 27, 2024
The bug repros for me on a React 18.3.0-canary-60a927d04-20240113 project without Nextjs.
Patch devtools before running useMemo function in strict mode (#28249)
Patch devtools before running useMemo function in strict mode (#28249)
Patch devtools before running useMemo function in strict mode (react#…
Patch devtools before running useMemo function in strict mode (#28249)