Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tomstuart
on April 10, 2022
|
parent
|
context
|
favorite
| on:
PSA: React 18 calls code twice in strict dev mode ...
Aside from being development-only, note that you also need to wrap a component in `<React.StrictMode>…</React.StrictMode>` to opt it into this.
tomduncalf
on April 10, 2022
[–]
Yeah, good point - I thought it could be that Next.js changed their default behaviour to use strict mode when they upgraded to React 18 but another comment says React 17 silenced the duplicate logs(!) so maybe the change is older than that.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: