diff --git a/src/content/learn/adding-interactivity.md b/src/content/learn/adding-interactivity.md index bc05a207..9a3d36e0 100644 --- a/src/content/learn/adding-interactivity.md +++ b/src/content/learn/adding-interactivity.md @@ -796,4 +796,4 @@ Pročitajte **[Update-ovanje Array-a u State-u](/learn/updating-arrays-in-state) Pređite na [Reagovanje na Event-e](/learn/responding-to-events) da biste počeli da čitate ovo poglavlje stranicu po stranicu! -Ili, ako ste već upoznati sa ovim temama, zašto ne biste pročitali [Upravljanje State-om](/learn/managing-state)? +Ili, ako ste već upoznati sa ovim temama, zašto ne biste pročitali [Upravljanje state-om](/learn/managing-state)? diff --git a/src/content/learn/managing-state.md b/src/content/learn/managing-state.md index 93bcc10f..669f6ca8 100644 --- a/src/content/learn/managing-state.md +++ b/src/content/learn/managing-state.md @@ -1,30 +1,30 @@ --- -title: Managing State +title: Upravljanje state-om --- -As your application grows, it helps to be more intentional about how your state is organized and how the data flows between your components. Redundant or duplicate state is a common source of bugs. In this chapter, you'll learn how to structure your state well, how to keep your state update logic maintainable, and how to share state between distant components. +Povećavanjem aplikacije, važno je da budete svesni kako vam je state organizovan i kako podaci teku kroz komponente. Suvišan ili dupliran state je čest uzrok bug-ova. U ovom poglavlju, naučićete kako da pravilno strukturirate state, kako da logika ažuriranja state-a bude održiva i kako da delite state između udaljenih komponenata. -* [How to think about UI changes as state changes](/learn/reacting-to-input-with-state) -* [How to structure state well](/learn/choosing-the-state-structure) -* [How to "lift state up" to share it between components](/learn/sharing-state-between-components) -* [How to control whether the state gets preserved or reset](/learn/preserving-and-resetting-state) -* [How to consolidate complex state logic in a function](/learn/extracting-state-logic-into-a-reducer) -* [How to pass information without "prop drilling"](/learn/passing-data-deeply-with-context) -* [How to scale state management as your app grows](/learn/scaling-up-with-reducer-and-context) +* [Kako da razmišljate o UI promenama kao promenama stanja](/learn/reacting-to-input-with-state) +* [Kako da pravilno strukturirate state](/learn/choosing-the-state-structure) +* [Kako da "podignete state" da bi ga delili između komponenata](/learn/sharing-state-between-components) +* [Kako da kontrolišete da li se state čuva ili resetuje](/learn/preserving-and-resetting-state) +* [Kako da grupišete kompleksnu state logiku u funkciju](/learn/extracting-state-logic-into-a-reducer) +* [Kako da prosledite informaciju bez "prop drilling-a"](/learn/passing-data-deeply-with-context) +* [Kako da skalirate upravljanje state-a dok aplikacija raste](/learn/scaling-up-with-reducer-and-context) -## Reacting to input with state {/*reacting-to-input-with-state*/} +## Reagovanje na input pomoću stanja {/*reacting-to-input-with-state*/} -With React, you won't modify the UI from code directly. For example, you won't write commands like "disable the button", "enable the button", "show the success message", etc. Instead, you will describe the UI you want to see for the different visual states of your component ("initial state", "typing state", "success state"), and then trigger the state changes in response to user input. This is similar to how designers think about UI. +Sa React-om, nećete direktno u kodu menjati UI. Na primer, nećete pisati komande poput "onemogući dugme", "omogući dugme", "prikaži uspešnu poruku", itd. Umesto toga, opisaćete kakav UI želite da vidite za različita vizuelna stanja vaše komponente ("inicijalno stanje", "stanje pisanja", "uspešno stanje"), a onda ćete pokrenuti promene state-a kao odgovor na korisnički input. Ovo je slično onome kako dizajneri razmišljaju o UI-u. -Here is a quiz form built using React. Note how it uses the `status` state variable to determine whether to enable or disable the submit button, and whether to show the success message instead. +Ovde je forma za kviz napravljena pomoću React-a. Primetite kako koristi `status` state promenljivu da odluči da li da omogući submit dugme i da li da prikaže uspešnu poruku. @@ -37,7 +37,7 @@ export default function Form() { const [status, setStatus] = useState('typing'); if (status === 'success') { - return

That's right!

+ return

To je tačno!

} async function handleSubmit(e) { @@ -58,9 +58,9 @@ export default function Form() { return ( <> -

City quiz

+

Kviz gradova

- In which city is there a billboard that turns air into drinkable water? + U kom gradu je bilbord koji pretvara vazduh u pijaću vodu?