Skip to content

Commit 258168d

Browse files
committed
quickstart-line-280
1 parent 039692c commit 258168d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/content/learn/index.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,21 @@ Kada vam nije potrebna `else` grana, možete koristiti i kraću [logičku `&&` s
219219
220220
Svi ovi pristupi takođe rade i za kondicionalno specificiranje atributa. Ako niste upoznati sa oovim delovima JavaScript sintakse, možete početi tako što ćete uvek koristiti `if...else`.
221221
222-
## Rendering lists {/*rendering-lists*/}
222+
## Renderovanje listi {/*rendering-lists*/}
223223
224-
You will rely on JavaScript features like [`for` loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for) and the [array `map()` function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) to render lists of components.
224+
Oslanjaćete se na JavaScript funkcionalnosti poput [`for` loop-a](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for) i [array `map()` funkcije](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) za renderovanje listi komponenata.
225225
226-
For example, let's say you have an array of products:
226+
Na primer, pretpostavimo da imate niz proizvoda:
227227
228228
```js
229229
const products = [
230-
{ title: 'Cabbage', id: 1 },
231-
{ title: 'Garlic', id: 2 },
232-
{ title: 'Apple', id: 3 },
230+
{ title: 'Kupus', id: 1 },
231+
{ title: 'Luk', id: 2 },
232+
{ title: 'Jabuka', id: 3 },
233233
];
234234
```
235235
236-
Inside your component, use the `map()` function to transform an array of products into an array of `<li>` items:
236+
Unutar vaše komponente, koristite `map()` funkciju da transformišete niz proizvoda u niz `<li>` stavki:
237237
238238
```js
239239
const listItems = products.map(product =>
@@ -247,15 +247,15 @@ return (
247247
);
248248
```
249249
250-
Notice how `<li>` has a `key` attribute. For each item in a list, you should pass a string or a number that uniquely identifies that item among its siblings. Usually, a key should be coming from your data, such as a database ID. React uses your keys to know what happened if you later insert, delete, or reorder the items.
250+
Primetite kako `<li>` poseduje `key` atribut. Za svaku stavku u listi, trebalo bi da prosledite string ili broj koji jedinstveno identifikuje tu stavku među njenim susedima. Obično, ključ (key) bi trebalo da dolazi iz vaših podataka, kao što je ID iz baze podataka. React koristi vaše ključeve (keys) da bi znao šta se dogodilo ako kasnije ubacite, izbrišete ili preuredite stavke.
251251
252252
<Sandpack>
253253
254254
```js
255255
const products = [
256-
{ title: 'Cabbage', isFruit: false, id: 1 },
257-
{ title: 'Garlic', isFruit: false, id: 2 },
258-
{ title: 'Apple', isFruit: true, id: 3 },
256+
{ title: 'Kupus', isFruit: false, id: 1 },
257+
{ title: 'Luk', isFruit: false, id: 2 },
258+
{ title: 'Jabuka', isFruit: true, id: 3 },
259259
];
260260

261261
export default function ShoppingList() {
@@ -278,9 +278,9 @@ export default function ShoppingList() {
278278
279279
</Sandpack>
280280
281-
## Responding to events {/*responding-to-events*/}
281+
## Reagovanje na event-e {/*responding-to-events*/}
282282
283-
You can respond to events by declaring *event handler* functions inside your components:
283+
Možete reagovati na event-e deklarisanjem *event handler-a* funkcija za obradu event-a unutar vaših komponenti:
284284
285285
```js {2-4,7}
286286
function MyButton() {

0 commit comments

Comments
 (0)