Learn how useState acts as a component's memory to track data like searchText. Discover why state changes trigger re-renders and why you must never mutate state directly to keep your UI in sync.

State is your component's memory; if you want it to remember something across re-renders, you must use the setter function to signal React to take a new snapshot of the UI.
Teach useState simply: state is component memory. Changing state triggers re-render. Use examples like isPlaying and searchText. Explain why direct mutation is wrong. One tiny code reference only.


Creado por exalumnos de la Universidad de Columbia en San Francisco
"Instead of endless scrolling, I just hit play on BeFreed. It saves me so much time."
"I never knew where to start with nonfiction—BeFreed’s book lists turned into podcasts gave me a clear path."
"Perfect balance between learning and entertainment. Finished ‘Thinking, Fast and Slow’ on my commute this week."
"Crazy how much I learned while walking the dog. BeFreed = small habits → big gains."
"Reading used to feel like a chore. Now it’s just part of my lifestyle."
"Feels effortless compared to reading. I’ve finished 6 books this month already."
"BeFreed turned my guilty doomscrolling into something that feels productive and inspiring."
"BeFreed turned my commute into learning time. 20-min podcasts are perfect for finishing books I never had time for."
"BeFreed replaced my podcast queue. Imagine Spotify for books — that’s it. 🙌"
"It is great for me to learn something from the book without reading it."
"The themed book list podcasts help me connect ideas across authors—like a guided audio journey."
"Makes me feel smarter every time before going to work"
Creado por exalumnos de la Universidad de Columbia en San Francisco

Lena: Jackson, have you ever used a website that felt like it had total amnesia? You type your name into a form, or you click "next" on a photo gallery, and... nothing. The page just stares back at you, completely forgetting what you just did.
Jackson: It’s the worst! And in React, that happens because components don't naturally "remember" things. If you just use a regular variable to track something like isPlaying or a searchText string, the component resets that variable to its starting value every time it runs. It’s like it’s living the same first day over and over again.
Lena: Right, it’s static. But that’s where useState comes in. It’s basically giving the component its own little brain or "memory" so it can actually hold onto those changes.
Jackson: Exactly, and the magic happens when that memory changes—it actually triggers React to re-render the whole UI to match. Let’s explore how this "memory" actually works under the hood.