Zum Hauptinhalt springen
Unix & Linux ServerSecurity: Ausführen beliebiger Kommandos in fetchmail (SUSE)(08.10.2026 um 00:17 Uhr)
•
Unix & Linux ServerSecurity: Zwei Probleme in rpcbind (SUSE)(08.10.2026 um 00:17 Uhr)
•
Unix & Linux ServerSecurity: Denial of Service in libXtst (SUSE)(08.10.2026 um 00:17 Uhr)
•
Linux Tipps & HardeningSecurity: Ausführen beliebiger Kommandos in xz-utils (Debian)(08.10.2026 um 07:27 Uhr)
•••••••
Unix & Linux ServerSecurity: Ausführen beliebiger Kommandos in fetchmail (SUSE)(08.10.2026 um 00:17 Uhr)
•
Unix & Linux ServerSecurity: Zwei Probleme in rpcbind (SUSE)(08.10.2026 um 00:17 Uhr)
•
Unix & Linux ServerSecurity: Denial of Service in libXtst (SUSE)(08.10.2026 um 00:17 Uhr)
•
Linux Tipps & HardeningSecurity: Ausführen beliebiger Kommandos in xz-utils (Debian)(08.10.2026 um 07:27 Uhr)
•••••••
Intelligence View
⚡ tsecurity.de Intelligence

Day 2 of #100DaysofCode — Understanding React State

Today marks the 2nd day of my 100 Days of Code journey. Today, the goal was to understand what is state in React and how does the useState works in React.…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

Today marks the 2nd day of my 100 Days of Code journey. Today, the goal was to understand what is state in React and how does the useState works in React. React state can feel abstract when you’re learning it. So let's understand it in a simple restaurant analogy that makes state, re-renders, and interactivity easy to understand.









What Is “State” in React?



State = the current order on a customer’s table.



At a restaurant, a table might currently have an order like:




  • Burger

  • Pizza

  • Coke



That order can change anytime.

In React, state tells the component what it should display right now, just like an order tells a waiter what food should be on the table.






But the question rises,






Why Do Functional Components Even Need State?



A restaurant table’s order changes throughout the meal.



Without state, a React component would be like a table that always shows the same dish, no matter what the customer asks for.



State allows:




  • Dynamic UI

  • Changing data

  • Responding to user actions



Just like a waiter updates the table based on new orders.









How Does State Make Components Interactive?



When a customer interacts (e.g., “Add fries,” “Change drink”), the order changes.



In React:




  • Click a button

  • Type in an input

  • Toggle something



→ State updates

→ Component updates



It’s like a waiter updating the table whenever the customer requests something.









Ok, So That Means State Is Asynchronous?



Yes.

React updates state after a short delay, not instantly.



Restaurant analogy:

You tell the waiter:




“Change my order from pizza to pasta.”




The waiter doesn’t teleport the pasta onto your table. They:




  • write it down

  • send it to the kitchen

  • update the order when ready



React does the same: it batches and schedules changes for smoother performance.









How Does Updating State Re-render a Component?



When the order on a table changes, the food on the table changes too.



React does this:




  1. State updates (“pizza → pasta”)

  2. React re-renders the component

  3. UI refreshes to show the new state



It’s like replacing the old dish with the new one.









Why Does the UI Always Show the Latest State?



Because the table should always show the current order, not old dishes customers no longer want.



React guarantees the UI is always synced with the latest state value.









What Is Re-rendering in React?



Re-rendering = refreshing what’s on the table based on the latest order.



New order → new dish

New state → new UI



Every change triggers a fresh, updated display.









So, To Summarize




  • State = the current order on a table

  • State changes = customer updating their order

  • Interactivity = customer actions updating what’s served

  • State is async because updates are scheduled efficiently

  • State change triggers re-render (new dish served)

  • UI always matches the latest order






If you liked this breakdown, follow along — this was Day 2 of my 100 Days of Code.

Verwandte Story-Cluster & Quellen (Vektor-KI)

2 Quellen
Security: Ausführen beliebiger Kommandos in fetchmail (SUSE)
1 weitere Quelle
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Day 2 of #100DaysofCode — Understanding React State

Thematisch verwandte Begriffe: 100DaysofCode, Understanding, React, State · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag