Adding Interactivity – React
6
Public whispers
6
Contributors
2026-07-28 09:17:53
First whispered
Public whispers on this page
Text Highlight2026-07-28 15:41:53
Original Highlight Excerpt
"you shouldn’t change objects and arrays that you hold in the React state directly."
Whisper Note
Wait, so I have to copy the whole array just to tweak one item? That feels wasteful but okay.
Text Highlight2026-07-28 12:38:53
Original Highlight Excerpt
"Setting it does not change the state variable you already have, but instead triggers a re-render."
Whisper Note
So it's like a photo, not a live video? Kinda makes sense but still weird.
Text Highlight2026-07-28 12:29:53
Original Highlight Excerpt
"Setting it does not change the state variable you already have, but instead triggers a re-render."
Whisper Note
That's why my console.log always shows the old value right after setState, took me a while to get it.
Text Highlight2026-07-28 09:35:53
Original Highlight Excerpt
"In React, data that changes over time is called state."
Whisper Note
reminds me of variables but with superpowers, nice explanation actually
Text Highlight2026-07-28 09:26:53
Original Highlight Excerpt
"In React, data that changes over time is called state."
Whisper Note
i always thought state was only for forms, good to know it's broader
Text Highlight2026-07-28 09:17:53
Original Highlight Excerpt
"In React, data that changes over time is called state."
Whisper Note
so basically state is just a fancy word for stuff that changes lol
Share this page's whispers
Short link
https://domwhisper.com/s/14ab7e48008bEmbed snippet
<iframe src="https://domwhisper.com/embed/14ab7e48008b" 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