Skip to content

Commit fde2cc6

Browse files
committed
quickstart-completed
1 parent a729bcf commit fde2cc6

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/content/learn/index.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -415,23 +415,23 @@ U ovom primeru, to je `MyApp`:
415415
416416
<DiagramGroup>
417417
418-
<Diagram name="sharing_data_parent" height={385} width={410} alt="Diagram showing a tree of three components, one parent labeled MyApp and two children labeled MyButton. MyApp contains a count value of zero which is passed down to both of the MyButton components, which also show value zero." >
418+
<Diagram name="sharing_data_parent" height={385} width={410} alt="Dijagram prikazuje stablo od tri komponente, jedne parent oznake MyApp i dve children sa oznakom MyButton. MyApp sadrži vrednost brojača nula, koja se prosleđuje u obe MyButton komponente, koje takođe prikazuju vrednost nula." >
419419
420-
Initially, `MyApp`'s `count` state is `0` and is passed down to both children
420+
Inicijalno, `MyApp` ima `count` state vrednosti `0` i prosleđuje se u obe children komponente
421421
422422
</Diagram>
423423
424-
<Diagram name="sharing_data_parent_clicked" height={385} width={410} alt="The same diagram as the previous, with the count of the parent MyApp component highlighted indicating a click with the value incremented to one. The flow to both of the children MyButton components is also highlighted, and the count value in each child is set to one indicating the value was passed down." >
424+
<Diagram name="sharing_data_parent_clicked" height={385} width={410} alt="Isti dijagram kao prethodni, sa istaknutim brojačem parent MyApp komponente, koji ukazuje na klik sa vrednošću uvećanom na jedan. Protok do obe children MyButton komponente je takođe istaknut, a vrednost brojača u svakoj child komponenti je postavljena na jedan što ukazuje da je vrednost prosleđena." >
425425
426-
On click, `MyApp` updates its `count` state to `1` and passes it down to both children
426+
Pri kliku, `MyApp` ažurira svoj `count` state na `1` i prosleđuje ga u obe children komponente
427427
428428
</Diagram>
429429
430430
</DiagramGroup>
431431
432-
Now when you click either button, the `count` in `MyApp` will change, which will change both of the counts in `MyButton`. Here's how you can express this in code.
432+
Sada, kada kliknete na bilo koje dugme, `count` u `MyApp` će se promeniti, što će promeniti oba brojača u `MyButton`. Evo kako to možete izraziti u kodu.
433433
434-
First, *move the state up* from `MyButton` into `MyApp`:
434+
Prvo, *pdignite state nagore* from `MyButton` u `MyApp`:
435435
436436
```js {2-6,18}
437437
export default function MyApp() {
@@ -443,20 +443,20 @@ export default function MyApp() {
443443

444444
return (
445445
<div>
446-
<h1>Counters that update separately</h1>
446+
<h1>Brojači koji se ažuriraju odvojeno</h1>
447447
<MyButton />
448448
<MyButton />
449449
</div>
450450
);
451451
}
452452

453453
function MyButton() {
454-
// ... we're moving code from here ...
454+
// ... premestamo kod odavde ...
455455
}
456456

457457
```
458458
459-
Then, *pass the state down* from `MyApp` to each `MyButton`, together with the shared click handler. You can pass information to `MyButton` using the JSX curly braces, just like you previously did with built-in tags like `<img>`:
459+
Zatim, *prosleđujemo state nadole* iz `MyApp` u oba `MyButton`, zajedno sa zajedničkim handlerom za klik. Informacije možete proslediti u `MyButton` koristeći kovrdžaste zagrade u JSX-u, baš kao što ste to ranije radili sa ugrađenim tagovima poput `<img>`:
460460
461461
```js {11-12}
462462
export default function MyApp() {
@@ -468,29 +468,29 @@ export default function MyApp() {
468468

469469
return (
470470
<div>
471-
<h1>Counters that update together</h1>
471+
<h1>Brojači koji se ažuriraju zajedno</h1>
472472
<MyButton count={count} onClick={handleClick} />
473473
<MyButton count={count} onClick={handleClick} />
474474
</div>
475475
);
476476
}
477477
```
478478
479-
The information you pass down like this is called _props_. Now the `MyApp` component contains the `count` state and the `handleClick` event handler, and *passes both of them down as props* to each of the buttons.
479+
Informacije koje na ovaj način prosleđujete nazivaju se *props*. Sada `MyApp` komponenta sadrži `count` state i `handleClick` event handler, i *prosleđuje obe nadole kao props* svakom od dugmeta.
480480
481-
Finally, change `MyButton` to *read* the props you have passed from its parent component:
481+
Konačno, promenite `MyButton` da *čita* props koje ste prosledili iz njegove parent komponente:
482482
483483
```js {1,3}
484484
function MyButton({ count, onClick }) {
485485
return (
486486
<button onClick={onClick}>
487-
Clicked {count} times
487+
Kliknuto {count} puta
488488
</button>
489489
);
490490
}
491491
```
492492
493-
When you click the button, the `onClick` handler fires. Each button's `onClick` prop was set to the `handleClick` function inside `MyApp`, so the code inside of it runs. That code calls `setCount(count + 1)`, incrementing the `count` state variable. The new `count` value is passed as a prop to each button, so they all show the new value. This is called "lifting state up". By moving state up, you've shared it between components.
493+
Kada kliknete na dugme, `onClick` handler se aktivira.`onClick` prop svakog dugmeta postavljen je na funkciju `handleClick` unutar `MyApp` pa se kod unutar nje izvršava. Taj kod poziva `setCount(count + 1)`, inkrementira `count` state varijablu. Nova `count` vrednost se prosleđuje kao prop svakom dugmetu, pa svi prikazuju novu vrednost. Ovo se naziva "podizanje state-a nagore". Pomeranjema state-a nagore, podelili ste ga između komponenata.
494494
495495
<Sandpack>
496496
@@ -506,7 +506,7 @@ export default function MyApp() {
506506

507507
return (
508508
<div>
509-
<h1>Counters that update together</h1>
509+
<h1>Brojači koji se ažuriraju zajedno</h1>
510510
<MyButton count={count} onClick={handleClick} />
511511
<MyButton count={count} onClick={handleClick} />
512512
</div>
@@ -516,7 +516,7 @@ export default function MyApp() {
516516
function MyButton({ count, onClick }) {
517517
return (
518518
<button onClick={onClick}>
519-
Clicked {count} times
519+
Kliknuto {count} puta
520520
</button>
521521
);
522522
}
@@ -531,8 +531,8 @@ button {
531531
532532
</Sandpack>
533533
534-
## Next Steps {/*next-steps*/}
534+
## Sledeći koraci {/*next-steps*/}
535535
536-
By now, you know the basics of how to write React code!
536+
Sada već znate osnove pisanja React koda!
537537
538-
Check out the [Tutorial](/learn/tutorial-tic-tac-toe) to put them into practice and build your first mini-app with React.
538+
Pogledajte [Tutorijal](/learn/tutorial-tic-tac-toe) biste primenili naučeno i izgradili svoj prvi mini-app sa React-om.

0 commit comments

Comments
 (0)