Skip to content

Commit b1efaba

Browse files
authored
Merge branch 'main' into RU-you-might-not-need-an-effect
2 parents 702a123 + 992b062 commit b1efaba

File tree

8 files changed

+35
-24
lines changed

8 files changed

+35
-24
lines changed

src/content/blog/2023/03/16/introducing-react-dev.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ Use the conditional operator (`cond ? a : b`) to render a ❌ if `isPacked` isn
269269
function Item({ name, isPacked }) {
270270
return (
271271
<li className="item">
272-
{name} {isPacked && ''}
272+
{name} {isPacked && ''}
273273
</li>
274274
);
275275
}
@@ -307,7 +307,7 @@ export default function PackingList() {
307307
function Item({ name, isPacked }) {
308308
return (
309309
<li className="item">
310-
{name} {isPacked ? '' : ''}
310+
{name} {isPacked ? '' : ''}
311311
</li>
312312
);
313313
}

src/content/community/conferences.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ September 19-21, 2024. Alicante, Spain.
4040

4141
[Website](https://reactalicante.es/) - [Twitter](https://twitter.com/ReactAlicante) - [YouTube](https://www.youtube.com/channel/UCaSdUaITU1Cz6PvC97A7e0w)
4242

43+
### RenderCon Kenya 2024 {/*rendercon-kenya-2024*/}
44+
October 04 - 05, 2024. Nairobi, Kenya
45+
46+
[Website](https://rendercon.org/) - [Twitter](https://twitter.com/renderconke) - [LinkedIn](https://www.linkedin.com/company/renderconke/) - [YouTube](https://www.youtube.com/channel/UC0bCcG8gHUL4njDOpQGcMIA)
4347

4448
### React India 2024 {/*react-india-2024*/}
4549
October 17 - 19, 2024. In-person in Goa, India (hybrid event) + Oct 15 2024 - remote day

src/content/learn/adding-interactivity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ setCount(count + 1); // Request a re-render with 1
265265
console.log(count); // Still 0!
266266
```
267267

268-
This behavior help you avoid subtle bugs. Here is a little chat app. Try to guess what happens if you press "Send" first and *then* change the recipient to Bob. Whose name will appear in the `alert` five seconds later?
268+
This behavior helps you avoid subtle bugs. Here is a little chat app. Try to guess what happens if you press "Send" first and *then* change the recipient to Bob. Whose name will appear in the `alert` five seconds later?
269269

270270
<Sandpack>
271271

src/content/learn/conditional-rendering.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ export default function PackingList() {
5252
</Sandpack>
5353
5454

55-
Обратите внимание, что у некоторых компонентов `Item` проп `isPacked` имеет значение `true`, вместо значения `false`. Если `isPacked={true}`, вы хотите добавить галочку() к упакованным вещам.
55+
Обратите внимание, что у некоторых компонентов `Item` проп `isPacked` имеет значение `true`, вместо значения `false`. Если `isPacked={true}`, вы хотите добавить галочку() к упакованным вещам.
5656

5757
Можно реализовать это с помощью [управляющей конструкции `if`/`else`](https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Statements/if...) таким образом:
5858

5959
```js
6060
if (isPacked) {
61-
return <li className="item">{name} </li>;
61+
return <li className="item">{name} </li>;
6262
}
6363
return <li className="item">{name}</li>;
6464
```
@@ -70,7 +70,7 @@ return <li className="item">{name}</li>;
7070
```js
7171
function Item({ name, isPacked }) {
7272
if (isPacked) {
73-
return <li className="item">{name} </li>;
73+
return <li className="item">{name} </li>;
7474
}
7575
return <li className="item">{name}</li>;
7676
}
@@ -159,7 +159,7 @@ export default function PackingList() {
159159
В предыдущем примере вы контролировали, какое JSX дерево будет возвращено компонентом (если вообще будет!). Возможно, вы уже заметили некоторое дублирование в выводе рендера:
160160

161161
```js
162-
<li className="item">{name} </li>
162+
<li className="item">{name} </li>
163163
```
164164

165165
очень похоже на
@@ -172,7 +172,7 @@ export default function PackingList() {
172172

173173
```js
174174
if (isPacked) {
175-
return <li className="item">{name} </li>;
175+
return <li className="item">{name} </li>;
176176
}
177177
return <li className="item">{name}</li>;
178178
```
@@ -187,7 +187,7 @@ return <li className="item">{name}</li>;
187187

188188
```js
189189
if (isPacked) {
190-
return <li className="item">{name} </li>;
190+
return <li className="item">{name} </li>;
191191
}
192192
return <li className="item">{name}</li>;
193193
```
@@ -197,12 +197,12 @@ return <li className="item">{name}</li>;
197197
```js
198198
return (
199199
<li className="item">
200-
{isPacked ? name + ' ' : name}
200+
{isPacked ? name + ' ' : name}
201201
</li>
202202
);
203203
```
204204

205-
Вы можете читать это как *"если `isPacked` равно true, тогда (`?`) рендерим `name + ' '`, в противном случае (`:`) рендерим `name`"*.
205+
Вы можете читать это как *"если `isPacked` равно true, тогда (`?`) рендерим `name + ' '`, в противном случае (`:`) рендерим `name`"*.
206206

207207
<DeepDive>
208208

@@ -222,7 +222,7 @@ function Item({ name, isPacked }) {
222222
<li className="item">
223223
{isPacked ? (
224224
<del>
225-
{name + ' '}
225+
{name + ' '}
226226
</del>
227227
) : (
228228
name
@@ -265,7 +265,7 @@ export default function PackingList() {
265265
```js
266266
return (
267267
<li className="item">
268-
{name} {isPacked && ''}
268+
{name} {isPacked && ''}
269269
</li>
270270
);
271271
```
@@ -280,7 +280,7 @@ return (
280280
function Item({ name, isPacked }) {
281281
return (
282282
<li className="item">
283-
{name} {isPacked && ''}
283+
{name} {isPacked && ''}
284284
</li>
285285
);
286286
}
@@ -337,7 +337,7 @@ let itemContent = name;
337337

338338
```js
339339
if (isPacked) {
340-
itemContent = name + ' ';
340+
itemContent = name + ' ';
341341
}
342342
```
343343

@@ -357,7 +357,7 @@ if (isPacked) {
357357
function Item({ name, isPacked }) {
358358
let itemContent = name;
359359
if (isPacked) {
360-
itemContent = name + ' ';
360+
itemContent = name + ' ';
361361
}
362362
return (
363363
<li className="item">
@@ -401,7 +401,7 @@ function Item({ name, isPacked }) {
401401
if (isPacked) {
402402
itemContent = (
403403
<del>
404-
{name + " "}
404+
{name + " "}
405405
</del>
406406
);
407407
}
@@ -464,7 +464,7 @@ export default function PackingList() {
464464
function Item({ name, isPacked }) {
465465
return (
466466
<li className="item">
467-
{name} {isPacked && ''}
467+
{name} {isPacked && ''}
468468
</li>
469469
);
470470
}
@@ -502,7 +502,7 @@ export default function PackingList() {
502502
function Item({ name, isPacked }) {
503503
return (
504504
<li className="item">
505-
{name} {isPacked ? '' : ''}
505+
{name} {isPacked ? '' : ''}
506506
</li>
507507
);
508508
}

src/content/learn/describing-the-ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ In this example, the JavaScript `&&` operator is used to conditionally render a
327327
function Item({ name, isPacked }) {
328328
return (
329329
<li className="item">
330-
{name} {isPacked && ''}
330+
{name} {isPacked && ''}
331331
</li>
332332
);
333333
}

src/content/learn/react-compiler.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ In addition to these docs, we recommend checking the [React Compiler Working Gro
121121
Prior to installing the compiler, you can first check to see if your codebase is compatible:
122122

123123
<TerminalBlock>
124-
npx react-compiler-healthcheck@latest
124+
npx react-compiler-healthcheck@experimental
125125
</TerminalBlock>
126126

127127
This script will:
@@ -143,7 +143,7 @@ Found no usage of incompatible libraries.
143143
React Compiler also powers an eslint plugin. The eslint plugin can be used **independently** of the compiler, meaning you can use the eslint plugin even if you don't use the compiler.
144144

145145
<TerminalBlock>
146-
npm install eslint-plugin-react-compiler
146+
npm install eslint-plugin-react-compiler@experimental
147147
</TerminalBlock>
148148

149149
Then, add it to your eslint config:
@@ -203,7 +203,7 @@ If you're starting a new project, you can enable the compiler on your entire cod
203203
### Babel {/*usage-with-babel*/}
204204

205205
<TerminalBlock>
206-
npm install babel-plugin-react-compiler
206+
npm install babel-plugin-react-compiler@experimental
207207
</TerminalBlock>
208208

209209
The compiler includes a Babel plugin which you can use in your build pipeline to run the compiler.
@@ -258,7 +258,7 @@ Next.js has an experimental configuration to enable the React Compiler. It autom
258258
- Install `babel-plugin-react-compiler`
259259

260260
<TerminalBlock>
261-
npm install next@canary babel-plugin-react-compiler
261+
npm install next@canary babel-plugin-react-compiler@experimental
262262
</TerminalBlock>
263263

264264
Then configure the experimental option in `next.config.js`:

src/content/reference/react/useLayoutEffect.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ function Tooltip() {
6767
6868
* Код внутри `useLayoutEffect` и все обновления состояния, запланированные из него, **блокируют браузер от перерисовки экрана.** При чрезмерном использовании это замедляет работу вашего приложения. По возможности предпочитайте [`useEffect`.](/reference/react/useEffect)
6969
70+
* If you trigger a state update inside `useLayoutEffect`, React will execute all remaining Effects immediately including `useEffect`.
71+
7072
---
7173
7274
## Использование {/*usage*/}

vercel.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
"destination": "/learn/rendering-lists#keeping-list-items-in-order-with-key",
2525
"permanent": false
2626
},
27+
{
28+
"source": "/docs/lists-and-keys",
29+
"destination": "/learn/rendering-lists#keeping-list-items-in-order-with-key",
30+
"permanent": false
31+
},
2732
{
2833
"source": "/link/invalid-hook-call",
2934
"destination": "/warnings/invalid-hook-call-warning",

0 commit comments

Comments
 (0)