react.dev favicon

Synchronizing with Effects – React

5
Public whispers
5
Contributors
2026-07-28 09:45:18
First whispered

Public whispers on this page

Text Highlight2026-07-28 13:06:18
Original Highlight Excerpt
"Every time your component renders, React will update the screen and then run the code inside useEffect."
Whisper Note
Unless you pass deps, right? Then it only runs when those change, not every render.
Text Highlight2026-07-28 12:57:18
Original Highlight Excerpt
"Every time your component renders, React will update the screen and then run the code inside useEffect."
Whisper Note
So the effect always runs after paint, not before? That's good to know for layout stuff.
Text Highlight2026-07-28 10:03:18
Original Highlight Excerpt
"Effects let you specify side effects that are caused by rendering itself, rather than by a particular event."
Whisper Note
I remember debugging a chat app where I put the connection in an event—big mistake.
Text Highlight2026-07-28 09:54:18
Original Highlight Excerpt
"Effects let you specify side effects that are caused by rendering itself, rather than by a particular event."
Whisper Note
Hmm, but doesn't that mean effects run on every render? Seems wasteful.
Text Highlight2026-07-28 09:45:18
Original Highlight Excerpt
"Effects let you specify side effects that are caused by rendering itself, rather than by a particular event."
Whisper Note
This finally makes the event vs effect distinction click for me.

Share this page's whispers

Share to X
Short link
https://domwhisper.com/s/a781b5db8e78
Embed snippet
<iframe src="https://domwhisper.com/embed/a781b5db8e78" width="100%" height="480" style="border:0;border-radius:16px" loading="lazy"></iframe>

See what people are discussing on react.dev

Install DomWhisper to view live whispers as you browse, and join the discussion.

Get the extension