From 6a4737682f36321e0a47bf4a745bc7e424fd39cd Mon Sep 17 00:00:00 2001 From: lxmarinkovic Date: Mon, 25 Nov 2024 22:11:08 +0100 Subject: [PATCH 1/2] first-draft --- src/content/learn/adding-interactivity.md | 99 +++++++++++------------ 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/src/content/learn/adding-interactivity.md b/src/content/learn/adding-interactivity.md index 5c87a3e7..12b7e7c2 100644 --- a/src/content/learn/adding-interactivity.md +++ b/src/content/learn/adding-interactivity.md @@ -1,30 +1,30 @@ --- -title: Adding Interactivity +title: Dodavanje interaktivnosti --- -Some things on the screen update in response to user input. For example, clicking an image gallery switches the active image. In React, data that changes over time is called *state.* You can add state to any component, and update it as needed. In this chapter, you'll learn how to write components that handle interactions, update their state, and display different output over time. +Neke stvari na ekranu se update-uju kao odgovor na korisnički unos. Na primer, klik na galeriju slika menja aktivnu sliku. U React-u, podaci koji se menjaju tokom vremena nazivaju se *state.* Možete dodati state bilo kojoj component-i i update-ovati je po potrebi. U ovom poglavlju naučićete kako da pišete component-e koji obrađuju interakcije, update-uju svoj state i prikazuju različite output-e tokom vremena. -* [How to handle user-initiated events](/learn/responding-to-events) -* [How to make components "remember" information with state](/learn/state-a-components-memory) -* [How React updates the UI in two phases](/learn/render-and-commit) -* [Why state doesn't update right after you change it](/learn/state-as-a-snapshot) -* [How to queue multiple state updates](/learn/queueing-a-series-of-state-updates) -* [How to update an object in state](/learn/updating-objects-in-state) -* [How to update an array in state](/learn/updating-arrays-in-state) +* [Kako da rukujette event-ima koje pokrene korisnik](/learn/responding-to-events) +* [Kako da učinite da component-e „pamte” informacije koristeći state](/learn/state-a-components-memory) +* [Kako React update-uje UI u dve faze](/learn/render-and-commit) +* [Zašto se state ne update-uje odmah nakon promene](/learn/state-as-a-snapshot) +* [Kako da složite seriju state update-ova](/learn/queueing-a-series-of-state-updates) +* [Kako da update-ujete objekat u state-u](/learn/updating-objects-in-state) +* [Kako da update-ujete array u state-u](/learn/updating-arrays-in-state) -## Responding to events {/*responding-to-events*/} +## Odgovaranje na event-e {/*responding-to-events*/} -React lets you add *event handlers* to your JSX. Event handlers are your own functions that will be triggered in response to user interactions like clicking, hovering, focusing on form inputs, and so on. +React vam omogućava da dodate *event handler*-e u vaš JSX. Event handler-i su vaše sopstvene funkcije koje će se pokrenuti kao odgovor na korisničke interakcije, poput klika, prelaženja mišem, fokusiranja na form input-e i tako dalje. -Built-in components like `