Skip to content

Commit 5f3b610

Browse files
committed
Translate introduction and Function and Class Components section
1 parent 4171c3b commit 5f3b610

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

content/docs/components-and-props.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,35 @@ prev: rendering-elements.html
1616
next: state-and-lifecycle.html
1717
---
1818

19-
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. This page provides an introduction to the idea of components. You can find a [detailed component API reference here](/docs/react-component.html).
19+
Komponenty pozwalają ci podzielić interfejs użytkownika na niezależne, pozwalające na ponowne użycie części i myśleć o każdej z nich osobno. Ta strona dostarcza wprowadzenie do pojęcia komponentów. Możesz znaleźć [szczegółowe odniesienie do API komponentów tutaj](/docs/react-component.html).
2020

21-
Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called "props") and return React elements describing what should appear on the screen.
21+
Koncepcyjnie, komponenty są jak javascriptowe funkcje. Przyjmują one arbirtalne wkłady (nazywane "właściwościami") i zwracają reactowe elementy opisujące co powinno się pojawić na ekranie.
2222

23-
## Function and Class Components {#function-and-class-components}
23+
## Komponenty funkcyjne i klasowe {#function-and-class-components}
2424

25-
The simplest way to define a component is to write a JavaScript function:
25+
Najprostszym sposobem na zdefiniowanie komponentu jest napisanie javascriptowej funkcji:
2626

2727
```js
2828
function Welcome(props) {
29-
return <h1>Hello, {props.name}</h1>;
29+
return <h1>Cześć, {props.name}</h1>;
3030
}
3131
```
3232

33-
This function is a valid React component because it accepts a single "props" (which stands for properties) object argument with data and returns a React element. We call such components "function components" because they are literally JavaScript functions.
33+
Ta funkcja jest uzasadnionym reactowym komponentem, bo przyjmuje pojedynczy argument "props" (który oznacza "właściwości" (ang. *properties*)) będący obiektem z danymi i zwraca reactowy element. Nazywamy takie komponenty "komponentami funkcyjnymi", bo są one dosłownie javascriptowymi funkcjami.
3434

35-
You can also use an [ES6 class](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Classes) to define a component:
35+
Możesz również używać [klasy ES6](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Classes) aby zdefiniować komponent:
3636

3737
```js
3838
class Welcome extends React.Component {
3939
render() {
40-
return <h1>Hello, {this.props.name}</h1>;
40+
return <h1>Cześć, {this.props.name}</h1>;
4141
}
4242
}
4343
```
4444

45-
The above two components are equivalent from React's point of view.
45+
Dwa powyższe komponenty są równoważne z punktu widzenia Reacta.
4646

47-
Classes have some additional features that we will discuss in the [next sections](/docs/state-and-lifecycle.html). Until then, we will use function components for their conciseness.
47+
Klasy mają kilka dodatkowych cech, które przedyskutujemy w [kolejnych rozdziałach](/docs/state-and-lifecycle.html). Na ten czas bedziemy używać komponentów funkcyjnych dla ich zwięzłości.
4848

4949
## Rendering a Component {#rendering-a-component}
5050

0 commit comments

Comments
 (0)