You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/learn/index.md
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -219,21 +219,21 @@ Kada vam nije potrebna `else` grana, možete koristiti i kraću [logičku `&&` s
219
219
220
220
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`.
221
221
222
-
## Rendering lists {/*rendering-lists*/}
222
+
## Renderovanje listi {/*rendering-lists*/}
223
223
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.
225
225
226
-
For example, let's say you have an array of products:
226
+
Na primer, pretpostavimo da imate niz proizvoda:
227
227
228
228
```js
229
229
constproducts= [
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 },
233
233
];
234
234
```
235
235
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:
237
237
238
238
```js
239
239
constlistItems=products.map(product=>
@@ -247,15 +247,15 @@ return (
247
247
);
248
248
```
249
249
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.
251
251
252
252
<Sandpack>
253
253
254
254
```js
255
255
constproducts= [
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 },
259
259
];
260
260
261
261
exportdefaultfunctionShoppingList() {
@@ -278,9 +278,9 @@ export default function ShoppingList() {
278
278
279
279
</Sandpack>
280
280
281
-
## Responding to events {/*responding-to-events*/}
281
+
## Reagovanje na event-e {/*responding-to-events*/}
282
282
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:
0 commit comments