From 31dd609c726dabaf3b2aa878e14d7e191937189f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20=C5=BBuber?= Date: Thu, 21 Mar 2019 12:20:54 +0100 Subject: [PATCH 01/32] List and keys translation --- content/docs/lists-and-keys.md | 133 +++++++++++++++++++++------------ 1 file changed, 87 insertions(+), 46 deletions(-) diff --git a/content/docs/lists-and-keys.md b/content/docs/lists-and-keys.md index 78857063c..9b560ce6e 100644 --- a/content/docs/lists-and-keys.md +++ b/content/docs/lists-and-keys.md @@ -1,30 +1,29 @@ --- id: lists-and-keys -title: Lists and Keys +title: Listy i klucze permalink: docs/lists-and-keys.html prev: conditional-rendering.html next: forms.html --- -First, let's review how you transform lists in JavaScript. - -Given the code below, we use the [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) function to take an array of `numbers` and double their values. We assign the new array returned by `map()` to the variable `doubled` and log it: +Na początku, przyjrzymy się jak przekształca się listy w JavaScript. +W kodzie poniżej, użyliśmy funkcji [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) aby wziąć tablicę `liczb`i podwoić och wartość. Następnie przypisujemy nową tablice zwróconą z funkcji `map()` do zmiennej `doubled` i wyświetlamy ją: ```javascript{2} const numbers = [1, 2, 3, 4, 5]; const doubled = numbers.map((number) => number * 2); console.log(doubled); ``` -This code logs `[2, 4, 6, 8, 10]` to the console. +Ten kod wyświetla w konsoli `[2, 4, 6, 8, 10]`. -In React, transforming arrays into lists of [elements](/docs/rendering-elements.html) is nearly identical. +W Reakcie, przekształcanie tablic do list [elementów](/docs/rendering-elements.html) jest niemalże identyczne -### Rendering Multiple Components {#rendering-multiple-components} +### Wyświetlanie wielu komponentów {#rendering-multiple-components} -You can build collections of elements and [include them in JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) using curly braces `{}`. +Możesz zbudować kolekcje elementów i [dodać je do JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) używając klamrowych nawiasów `{}`. -Below, we loop through the `numbers` array using the JavaScript [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) function. We return a `
  • ` element for each item. Finally, we assign the resulting array of elements to `listItems`: +Poniżej, iterujemy tablicę `liczb` używając funkcji [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) JavaScript. Zwracamy element `
  • ` dla każdego elementu tablicy. Na koniec, przypisujemy wynikową tablie do `listItems`: ```javascript{2-4} const numbers = [1, 2, 3, 4, 5]; @@ -33,7 +32,7 @@ const listItems = numbers.map((number) => ); ``` -We include the entire `listItems` array inside a `