Goodbye, useEffect: David Khourshid - YouTube

Reactathon 2022 の発表動画。

is not for Effects

What is useEffect() for?

動画内に出てくる @dan_abramov さんのツイートはこれ。

Can event handlers have side effects?
Absolutely! Event handlers are the best place for side effects.

Where do action effects go?
Event handlers.
In state transitions.
...which happen to be executed at the same time as event handler.

Effects are state management.
Don't put side-effects aside.


useEffect is for synchronization (not for effects と口頭で補足していた)
State transitions trigger effects
Effects go in event handler
Render-as-you-fetch (suspense)
Model effects with state machine

Source: React Status Issue 292: June 8, 2022