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
tl;dr Executing code twice in DEV is one of the things StrictMode does to detect side effects. React temporarily overrides console APIs like log before the second invocation to avoid double spamming the console.
This is a bit of a controversial decision but it seemed like the better of the two options.
React version:17.0.1
Steps To Reproduce
Link to code example:
https://codesandbox.io/s/vigilant-tree-igscd
The current behavior
The console.log in setSlot only exec once.
The expected behavior
Exec the console.log twice in setSlot funciton.
The text was updated successfully, but these errors were encountered: