Skip to content

Commit 236ac48

Browse files
merging all conflicts
2 parents ce3bac7 + 6682068 commit 236ac48

15 files changed

+389
-42
lines changed

content/blog/2020-10-20-react-v17.md

Lines changed: 169 additions & 0 deletions
Large diffs are not rendered by default.

content/docs/add-react-to-a-website.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,17 @@ A következőben adj hozzá három `<script>` címkét közvetlenül a záró `<
5252
```html{5,6,9}
5353
<!-- ... más HTML ... -->
5454
55+
<<<<<<< HEAD
5556
<!-- A React betöltése. -->
5657
<!-- Megjegyzés: publikáláskor, cseréld le a "development.js"-t "production.min.js"-re. -->
5758
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
5859
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
60+
=======
61+
<!-- Load React. -->
62+
<!-- Note: when deploying, replace "development.js" with "production.min.js". -->
63+
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
64+
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>
65+
>>>>>>> 6682068641c16df6547b3fcdb7877e71bb0bebf9
5966
6067
<!-- A React komponensünk betöltése. -->
6168
<script src="like_button.js"></script>
@@ -85,7 +92,11 @@ const domContainer = document.querySelector('#like_button_container');
8592
ReactDOM.render(e(LikeButton), domContainer);
8693
```
8794

95+
<<<<<<< HEAD
8896
Ez a két sor kód megtalálja a `<div>`-et, amit a HTML-hez adtunk az első lépésben, és megjeleníti benne a "Tetszik" React komponens gombunkat.
97+
=======
98+
These two lines of code find the `<div>` we added to our HTML in the first step, and then display our "Like" button React component inside of it.
99+
>>>>>>> 6682068641c16df6547b3fcdb7877e71bb0bebf9
89100
90101
### És ennyi! {#thats-it}
91102

@@ -116,8 +127,8 @@ Mielőtt a weboldalt végstádiumba publikálod, tartsd szem előtt, hogy a nem
116127
Ha már csökkented az alkalmazásod scriptjeinek a méretét, **az oldalad készen áll a végstádiumra**, amennyiben a publikált HTML oldalad a `production.min.js` végződésű React verziót tölti be:
117128

118129
```js
119-
<script src="https://unpkg.com/react@16/umd/react.production.min.js" crossorigin></script>
120-
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js" crossorigin></script>
130+
<script src="https://unpkg.com/react@17/umd/react.production.min.js" crossorigin></script>
131+
<script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js" crossorigin></script>
121132
```
122133

123134
Ha nincs kódcsökkentő lépésed a scriptekhez, [itt egy módja, hogyan tudod ezt beállítani](https://gist.github.com/gaearon/42a2ffa41b8319948f9be4076286e1f3).
@@ -185,7 +196,7 @@ Gratulálunk! Ezzel **beállítottad a JSX publikálásra kész** használatát
185196
Készíts egy `src` nevű mappát és futtasd az alábbi parancsot a terminálodban:
186197

187198
```
188-
npx babel --watch src --out-dir . --presets react-app/prod
199+
npx babel --watch src --out-dir . --presets react-app/prod
189200
```
190201

191202
>Megjegyzés

content/docs/cdn-links.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ next: release-channels.html
99
A React és a ReactDOM egyaránt elérhető CDN-en keresztül.
1010

1111
```html
12-
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
13-
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
12+
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
13+
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
1414
```
1515

1616
A fenti verziók csak a fejlesztésre értendőek, és nem megfelelőek éles környezetben való használathoz. A React kicsinyített és optimalizált változatai a következő helyen érhetőek el:
1717

1818
```html
19-
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
20-
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
19+
<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
20+
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
2121
```
2222

23+
<<<<<<< HEAD
2324
A `react` és a `react-dom` adott verziójának betöltéséhez cseréld ki a `16`-ot a verziószámra.
25+
=======
26+
To load a specific version of `react` and `react-dom`, replace `17` with the version number.
27+
>>>>>>> 6682068641c16df6547b3fcdb7877e71bb0bebf9
2428
2529
### Miért szükséges a `crossorigin` attribútum? {#why-the-crossorigin-attribute}
2630

content/docs/faq-functions.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ class Searchbox extends React.Component {
289289
}
290290

291291
handleChange(e) {
292-
// React pools events, so we read the value before debounce.
293-
// Alternately we could call `event.persist()` and pass the entire event.
294-
// For more info see reactjs.org/docs/events.html#event-pooling
295292
this.emitChangeDebounced(e.target.value);
296293
}
297294

content/docs/legacy-event-pooling.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
id: legacy-event-pooling
3+
title: Event Pooling
4+
permalink: docs/legacy-event-pooling.html
5+
---
6+
7+
>Note
8+
>
9+
>This page is only relevant for React 16 and earlier, and for React Native.
10+
>
11+
>React 17 on the web **does not** use event pooling.
12+
>
13+
>[Read more](/blog/2020/08/10/react-v17-rc.html#no-event-pooling) about this change in React 17.
14+
15+
The [`SyntheticEvent`](/docs/events.html) objects are pooled. This means that the `SyntheticEvent` object will be reused and all properties will be nullified after the event event handler has been called. For example, this won't work:
16+
17+
```javascript
18+
function handleChange(e) {
19+
// This won't work because the event object gets reused.
20+
setTimeout(() => {
21+
console.log(e.target.value); // Too late!
22+
}, 100);
23+
}
24+
```
25+
26+
If you need to access event object's properties after the event handler has run, you need to call `e.persist()`:
27+
28+
```javascript
29+
function handleChange(e) {
30+
// Prevents React from resetting its properties:
31+
e.persist();
32+
33+
setTimeout(() => {
34+
console.log(e.target.value); // Works
35+
}, 100);
36+
}
37+
```

content/docs/optimizing-performance.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Remember that this is only necessary before deploying to production. For normal
4343
We offer production-ready versions of React and React DOM as single files:
4444

4545
```html
46-
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
47-
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
46+
<script src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
47+
<script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
4848
```
4949

5050
Remember that only React files ending with `.production.min.js` are suitable for production.
@@ -75,10 +75,10 @@ For the most efficient Browserify production build, install a few plugins:
7575

7676
```
7777
# If you use npm
78-
npm install --save-dev envify terser uglifyify
78+
npm install --save-dev envify terser uglifyify
7979
8080
# If you use Yarn
81-
yarn add --dev envify terser uglifyify
81+
yarn add --dev envify terser uglifyify
8282
```
8383

8484
To create a production build, make sure that you add these transforms **(the order matters)**:
@@ -379,7 +379,7 @@ function updateColorMap(colormap) {
379379
}
380380
```
381381

382-
This feature was added to JavaScript in ES2018.
382+
This feature was added to JavaScript in ES2018.
383383

384384
If you're using Create React App, both `Object.assign` and the object spread syntax are available by default.
385385

content/docs/reference-events.md

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ string type
3434

3535
> Megjegyzés:
3636
>
37+
<<<<<<< HEAD
3738
> A v0.14-től kezdve `false` érték visszaadása egy eseménykezelőben nem állítja meg az esemény terjedését. Ehelyett manuálisan kell, hogy meghívd vagy az `e.stopPropagation()`-t, vagy az `e.preventDefault`-ot, attól függően melyik a helyes a te esetedben.
3839
3940
### Események összegyűjtése {#event-pooling}
@@ -60,9 +61,13 @@ function onClick(event) {
6061
this.setState({eventType: event.type});
6162
}
6263
```
64+
=======
65+
> As of v17, `e.persist()` doesn't do anything because the `SyntheticEvent` is no longer [pooled](/docs/legacy-event-pooling.html).
66+
>>>>>>> 6682068641c16df6547b3fcdb7877e71bb0bebf9
6367
6468
> Megjegyzés:
6569
>
70+
<<<<<<< HEAD
6671
> Ha szeretnél az események tulajdonságaihoz aszinkron módon hozzáférni, meg kell hogy hívd az `event.persist()` metódust az eseményen, ami eltávolítja a szintetikus eseményt a medencéből és lehetővé teszi az eseményre mutató hivatkozások megtartását felhasználói kóddal.
6772
6873
## Támogatott események {#supported-events}
@@ -92,6 +97,33 @@ Az alábbi eseménykezelők egy esemény által lettek elindítva a "bubbling" f
9297
- [Animáció-események {#animation-events}](#animáció-események-animation-events)
9398
- [Átmenet-események {#transition-events}](#átmenet-események-transition-events)
9499
- [Egyéb események {#other-events}](#egyéb-események-other-events)
100+
=======
101+
> As of v0.14, returning `false` from an event handler will no longer stop event propagation. Instead, `e.stopPropagation()` or `e.preventDefault()` should be triggered manually, as appropriate.
102+
103+
## Supported Events {#supported-events}
104+
105+
React normalizes events so that they have consistent properties across different browsers.
106+
107+
The event handlers below are triggered by an event in the bubbling phase. To register an event handler for the capture phase, append `Capture` to the event name; for example, instead of using `onClick`, you would use `onClickCapture` to handle the click event in the capture phase.
108+
109+
- [Clipboard Events](#clipboard-events)
110+
- [Composition Events](#composition-events)
111+
- [Keyboard Events](#keyboard-events)
112+
- [Focus Events](#focus-events)
113+
- [Form Events](#form-events)
114+
- [Generic Events](#generic-events)
115+
- [Mouse Events](#mouse-events)
116+
- [Pointer Events](#pointer-events)
117+
- [Selection Events](#selection-events)
118+
- [Touch Events](#touch-events)
119+
- [UI Events](#ui-events)
120+
- [Wheel Events](#wheel-events)
121+
- [Media Events](#media-events)
122+
- [Image Events](#image-events)
123+
- [Animation Events](#animation-events)
124+
- [Transition Events](#transition-events)
125+
- [Other Events](#other-events)
126+
>>>>>>> 6682068641c16df6547b3fcdb7877e71bb0bebf9
95127
96128
* * *
97129

@@ -171,10 +203,84 @@ Ezek a fókuszálás-események minden elemen működnek a React DOM-ban, nem cs
171203

172204
Tulajdonságok:
173205

174-
```javascript
206+
```js
175207
DOMEventTarget relatedTarget
176208
```
177209

210+
#### onFocus
211+
212+
The `onFocus` event is called when the element (or some element inside of it) receives focus. For example, it's called when the user clicks on a text input.
213+
214+
```javascript
215+
function Example() {
216+
return (
217+
<input
218+
onFocus={(e) => {
219+
console.log('Focused on input');
220+
}}
221+
placeholder="onFocus is triggered when you click this input."
222+
/>
223+
)
224+
}
225+
```
226+
227+
#### onBlur
228+
229+
The `onBlur` event handler is called when focus has left the element (or left some element inside of it). For example, it's called when the user clicks outside of a focused text input.
230+
231+
```javascript
232+
function Example() {
233+
return (
234+
<input
235+
onBlur={(e) => {
236+
console.log('Triggered because this input lost focus');
237+
}}
238+
placeholder="onBlur is triggered when you click this input and then you click outside of it."
239+
/>
240+
)
241+
}
242+
```
243+
244+
#### Detecting Focus Entering and Leaving
245+
246+
You can use the `currentTarget` and `relatedTarget` to differentiate if the focusing or blurring events originated from _outside_ of the parent element. Here is a demo you can copy and paste that shows how to detect focusing a child, focusing the element itself, and focus entering or leaving the whole subtree.
247+
248+
```javascript
249+
function Example() {
250+
return (
251+
<div
252+
tabIndex={1}
253+
onFocus={(e) => {
254+
if (e.currentTarget === e.target) {
255+
console.log('focused self');
256+
} else {
257+
console.log('focused child', e.target);
258+
}
259+
if (!e.currentTarget.contains(e.relatedTarget)) {
260+
// Not triggered when swapping focus between children
261+
console.log('focus entered self');
262+
}
263+
}}
264+
onBlur={(e) => {
265+
if (e.currentTarget === e.target) {
266+
console.log('unfocused self');
267+
} else {
268+
console.log('unfocused child', e.target);
269+
}
270+
if (!e.currentTarget.contains(e.relatedTarget)) {
271+
// Not triggered when swapping focus between children
272+
console.log('focus left self');
273+
}
274+
}}
275+
>
276+
<input id="1" />
277+
<input id="2" />
278+
</div>
279+
);
280+
}
281+
```
282+
283+
178284
* * *
179285

180286
### Űrlapesemények {#form-events}
@@ -310,7 +416,15 @@ Eseménynevek:
310416
onScroll
311417
```
312418

419+
<<<<<<< HEAD
313420
Tulajdonságok:
421+
=======
422+
>Note
423+
>
424+
>Starting with React 17, the `onScroll` event **does not bubble** in React. This matches the browser behavior and prevents the confusion when a nested scrollable element fires events on a distant parent.
425+
426+
Properties:
427+
>>>>>>> 6682068641c16df6547b3fcdb7877e71bb0bebf9
314428
315429
```javascript
316430
number detail

content/docs/testing-recipes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ let container = null;
377377
beforeEach(() => {
378378
// setup a DOM element as a render target
379379
container = document.createElement("div");
380-
// container *must* be attached to document so events work correctly.
381380
document.body.appendChild(container);
382381
});
383382
@@ -416,7 +415,7 @@ it("changes value when clicked", () => {
416415
});
417416
```
418417

419-
Different DOM events and their properties are described in [MDN](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent). Note that you need to pass `{ bubbles: true }` in each event you create for it to reach the React listener because React automatically delegates events to the document.
418+
Different DOM events and their properties are described in [MDN](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent). Note that you need to pass `{ bubbles: true }` in each event you create for it to reach the React listener because React automatically delegates events to the root.
420419

421420
> Note:
422421
>

content/versions.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
- title: '17.0.1'
2+
changelog: https://github.com/facebook/react/blob/master/CHANGELOG.md#1701-october-22-2020
3+
- title: '17.0.0'
4+
changelog: https://github.com/facebook/react/blob/master/CHANGELOG.md#1700-october-20-2020
15
- title: '16.14.0'
26
changelog: https://github.com/facebook/react/blob/master/CHANGELOG.md#16140-october-14-2020
37
- title: '16.13.1'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"normalize.css": "^8.0.0",
4848
"prettier": "^1.7.4",
4949
"prismjs": "^1.15.0",
50-
"react": "^17.0.0-rc.3",
51-
"react-dom": "^17.0.0-rc.3",
50+
"react": "^17.0.1",
51+
"react-dom": "^17.0.1",
5252
"react-helmet": "^5.2.0",
5353
"react-live": "1.8.0-0",
5454
"remarkable": "^1.7.1",

0 commit comments

Comments
 (0)