Skip to content

Commit 1ab5072

Browse files
committed
Resolve merge conflicts
1 parent 09be0e4 commit 1ab5072

File tree

6 files changed

+12
-72
lines changed

6 files changed

+12
-72
lines changed

src/content/learn/add-react-to-an-existing-project.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ title: Інтеграція React у наявний проєкт
2424
2. **Позначте `/some-app` як *базовий шлях*** у конфігурації вашого фреймворку (ось як: [Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath), [Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/)).
2525
3. **Налаштуйте свій сервер або проксі**, щоб всі запити під шляхом `/some-app/` оброблялися вашим React-застосунком.
2626

27-
<<<<<<< HEAD
28-
Це надасть React-частині вашого застосунку всі [переваги від найкращих практик](/learn/start-a-new-react-project#can-i-use-react-without-a-framework), вбудованих у ці фреймворки.
29-
=======
30-
This ensures the React part of your app can [benefit from the best practices](/learn/build-a-react-app-from-scratch#consider-using-a-framework) baked into those frameworks.
31-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
27+
Це надасть React-частині вашого застосунку всі [переваги від найкращих практик](/learn/build-a-react-app-from-scratch#consider-using-a-framework), вбудованих у ці фреймворки.
3228

3329
Багато фреймворків на основі React є повностековими (full-stack) та дають змогу вашому React-застосунку скористатися можливостями сервера. Однак ви можете використовувати цей же підхід, навіть якщо у вас немає змоги або бажання виконувати JavaScript на сервері. У цьому випадку слід надавати експорт HTML/CSS/JS ([результат `next export`](https://nextjs.org/docs/advanced-features/static-html-export) для Next.js, стандартно для Gatsby) за адресою `/some-app/`.
3430

src/content/learn/typescript.md

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,16 @@ TypeScript — це популярний спосіб додавання виз
1111

1212
<YouWillLearn>
1313

14-
<<<<<<< HEAD
1514
* [TypeScript з компонентами React](/learn/typescript#typescript-with-react-components)
1615
* [Приклади типізації для хуків](/learn/typescript#example-hooks)
17-
* [Найпоширеніші типи з пакету `@types/react`](/learn/typescript/#useful-types)
18-
* [Де дізнатись більше](/learn/typescript/#further-learning)
19-
=======
20-
* [TypeScript with React Components](/learn/typescript#typescript-with-react-components)
21-
* [Examples of typing with Hooks](/learn/typescript#example-hooks)
22-
* [Common types from `@types/react`](/learn/typescript#useful-types)
23-
* [Further learning locations](/learn/typescript#further-learning)
24-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
16+
* [Найпоширеніші типи з пакету `@types/react`](/learn/typescript#useful-types)
17+
* [Де дізнатись більше](/learn/typescript#further-learning)
2518

2619
</YouWillLearn>
2720

2821
## Встановлення {/*installation*/}
2922

30-
<<<<<<< HEAD
31-
Усі [готові для впровадження React-фреймворки](/learn/start-a-new-react-project#production-grade-react-frameworks) підтримують використання TypeScript. Дотримуйтесь інструкції для встановлення у відповідному фреймворку:
32-
=======
33-
All [production-grade React frameworks](/learn/start-a-new-react-project#full-stack-frameworks) offer support for using TypeScript. Follow the framework specific guide for installation:
34-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
23+
Усі [готові для впровадження React-фреймворки](/learn/start-a-new-react-project#full-stack-frameworks) підтримують використання TypeScript. Дотримуйтесь інструкції для встановлення у відповідному фреймворку:
3524

3625
- [Next.js](https://nextjs.org/docs/app/building-your-application/configuring/typescript)
3726
- [Remix](https://remix.run/docs/en/1.19.2/guides/typescript)
@@ -135,11 +124,7 @@ export default App = AppTSX;
135124

136125
## Приклади для хуків {/*example-hooks*/}
137126

138-
<<<<<<< HEAD
139127
Визначення типів з пакету `@types/react` включають типи вбудованих хуків для використання у компонентах без додаткових налаштувань. Вони створені з урахуванням коду у вашому компоненті, тому ви часто отримуватиме [виведені типи (inferred types)](https://www.typescriptlang.org/docs/handbook/type-inference.html) і, в ідеалі, не матимете потреби розбиратися з дрібницями надання типів.
140-
=======
141-
The type definitions from `@types/react` include types for the built-in Hooks, so you can use them in your components without any additional setup. They are built to take into account the code you write in your component, so you will get [inferred types](https://www.typescriptlang.org/docs/handbook/type-inference.html) a lot of the time and ideally do not need to handle the minutiae of providing the types.
142-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
143128

144129
Розглянемо кілька прикладів того, як вказати типи для хуків.
145130

@@ -154,13 +139,8 @@ const [enabled, setEnabled] = useState(false);
154139

155140
У цьому прикладі тип `boolean` буде заданий для змінної `enabled`, а `setEnabled` буде функцією, яка приймає або аргумент типу `boolean`, або функцію, що повертає `boolean`. Якщо ви хочете явно вказати тип для стану, передайте аргумент типу у виклику `useState`:
156141

157-
<<<<<<< HEAD
158142
```ts
159143
// Явно задати тип "boolean"
160-
=======
161-
```ts
162-
// Explicitly set the type to "boolean"
163-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
164144
const [enabled, setEnabled] = useState<boolean>(false);
165145
```
166146

@@ -304,11 +284,7 @@ export default App = AppTSX;
304284

305285
</Sandpack>
306286

307-
<<<<<<< HEAD
308287
Ця техніка спрацьовує, коли у вас є початкове значення з певним змістом, але іноді його немає, і тоді `null` може здатися прийнятним початковим значенням. Однак, щоб дозволити системі типізації розуміти ваш код, вам потрібно явно задати `ContextShape | null` для `createContext`.
309-
=======
310-
This technique works when you have a default value which makes sense - but there are occasionally cases when you do not, and in those cases `null` can feel reasonable as a default value. However, to allow the type-system to understand your code, you need to explicitly set `ContextShape | null` on the `createContext`.
311-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
312288

313289
Це спричиняє необхідність усунення `| null` з типу для споживачів контексту. Ми рекомендуємо, щоб хук здійснював перевірку під час виконання щодо існування значення та викидав помилку, якщо воно відсутнє:
314290

@@ -353,17 +329,13 @@ function MyComponent() {
353329
354330
### `useMemo` {/*typing-usememo*/}
355331
356-
<<<<<<< HEAD
357-
Хуки [`useMemo`](/reference/react/useMemo) створять/повторно отримають доступ до збереженого значення після виклику функції і повторно викличуть функцію лише тоді, коли зміняться його залежності, що передані як другий параметр. Результат виклику хука виводиться зі значення, яке повертає функція у першому параметрі. Але також можна явно передати аргумент типу хуку.
358-
=======
359332
<Note>
360333
361-
[React Compiler](/learn/react-compiler) automatically memoizes values and functions, reducing the need for manual `useMemo` calls. You can use the compiler to handle memoization automatically.
334+
[Компілятор React](/learn/react-compiler) автоматично запам'ятовує значення та функції, зменшуючи потребу в ручних викликах `useMemo`. Ви можете використовувати компілятор для автоматичної обробки мемоїзації.
362335

363336
</Note>
364337

365-
The [`useMemo`](/reference/react/useMemo) Hooks will create/re-access a memorized value from a function call, re-running the function only when dependencies passed as the 2nd parameter are changed. The result of calling the Hook is inferred from the return value from the function in the first parameter. You can be more explicit by providing a type argument to the Hook.
366-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
338+
Хуки [`useMemo`](/reference/react/useMemo) створять/повторно отримають доступ до збереженого значення після виклику функції і повторно викличуть функцію лише тоді, коли зміняться його залежності, що передані як другий параметр. Результат виклику хука виводиться зі значення, яке повертає функція у першому параметрі. Але також можна явно передати аргумент типу хуку.
367339

368340
```ts
369341
// Тип змінної visibleTodos виведений зі значення, поверненого з функції filterTodos
@@ -373,17 +345,13 @@ const visibleTodos = useMemo(() => filterTodos(todos, tab), [todos, tab]);
373345

374346
### `useCallback` {/*typing-usecallback*/}
375347

376-
<<<<<<< HEAD
377-
[Хук `useCallback`](/reference/react/useCallback) надає однакове посилання на функцію, допоки залежності у другому параметрі залишаються тими ж. Як і в `useMemo`, тип функції виводиться зі значення, що повертається функцією у першому параметрі, і також можна явно передати аргумент типу хуку.
378-
=======
379348
<Note>
380349

381-
[React Compiler](/learn/react-compiler) automatically memoizes values and functions, reducing the need for manual `useCallback` calls. You can use the compiler to handle memoization automatically.
350+
[Компілятор React](/learn/react-compiler) автоматично запам'ятовує значення та функції, зменшуючи потребу в ручних викликах `useMemo`. Ви можете використовувати компілятор для автоматичної обробки мемоїзації.
382351
383352
</Note>
384353
385-
The [`useCallback`](/reference/react/useCallback) provide a stable reference to a function as long as the dependencies passed into the second parameter are the same. Like `useMemo`, the function's type is inferred from the return value of the function in the first parameter, and you can be more explicit by providing a type argument to the Hook.
386-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
354+
[Хук `useCallback`](/reference/react/useCallback) надає однакове посилання на функцію, допоки залежності у другому параметрі залишаються тими ж. Як і в `useMemo`, тип функції виводиться зі значення, що повертається функцією у першому параметрі, і також можна явно передати аргумент типу хуку.
387355
388356
389357
```ts
@@ -394,11 +362,7 @@ const handleClick = useCallback(() => {
394362
395363
Під час роботи TypeScript у строгому режимі (strict mode) `useCallback` вимагає додавання типів для параметрів функції зворотного виклику. Це тому, що тип функції зворотного виклику виводиться зі значення, поверненого з функції, і без знання параметрів його не можливо точно визначити.
396364
397-
<<<<<<< HEAD
398365
Залежно від уподобань щодо стилю коду ви можете використовувати функції `*EventHandler` з типами React, щоб надати тип обробнику подій одночасно з визначенням функції зворотного виклику:
399-
=======
400-
Depending on your code-style preferences, you could use the `*EventHandler` functions from the React types to provide the type for the event handler at the same time as defining the callback:
401-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
402366
403367
```ts
404368
import { useState, useCallback } from 'react';
@@ -481,11 +445,7 @@ interface ModalRendererProps {
481445
}
482446
```
483447
484-
<<<<<<< HEAD
485448
Важливо зазначити, що ви не можете використовувати TypeScript для опису того, що дочірні елементи є певним типом JSX-елементів, тому ви не можете використовувати систему типів для опису компонента, який приймає лише елементи `<li>`.
486-
=======
487-
Note, that you cannot use TypeScript to describe that the children are a certain type of JSX elements, so you cannot use the type-system to describe a component which only accepts `<li>` children.
488-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
489449
490450
Ви можете побачити приклад із використанням `React.ReactNode` і `React.ReactElement` та перевіркою типів у [цій пісочниці TypeScript](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wChSB6CxYmAOmXRgDkIATJOdNJMGAZzgwAFpxAR+8YADswAVwGkZMJFEzpOjDKw4AFHGEEBvUnDhphwADZsi0gFw0mDWjqQBuUgF9yaCNMlENzgAXjgACjADfkctFnYkfQhDAEpQgD44AB42YAA3dKMo5P46C2tbJGkvLIpcgt9-QLi3AEEwMFCItJDMrPTTbIQ3dKywdIB5aU4kKyQQKpha8drhhIGzLLWODbNs3b3s8YAxKBQAcwXpAThMaGWDvbH0gFloGbmrgQfBzYpd1YjQZbEYARkB6zMwO2SHSAAlZlYIBCdtCRkZpHIrFYahQYQD8UYYFA5EhcfjyGYqHAXnJAsIUHlOOUbHYhMIIHJzsI0Qk4P9SLUBuRqXEXEwAKKfRZcNA8PiCfxWACecAAUgBlAAacFm80W-CU11U6h4TgwUv11yShjgJjMLMqDnN9Dilq+nh8pD8AXgCHdMrCkWisVoAet0R6fXqhWKhjKllZVVxMcavpd4Zg7U6Qaj+2hmdG4zeRF10uu-Aeq0LBfLMEe-V+T2L7zLVu+FBWLdLeq+lc7DYFf39deFVOotMCACNOCh1dq219a+30uC8YWoZsRyuEdjkevR8uvoVMdjyTWt4WiSSydXD4NqZP4AymeZE072ZzuUeZQKheQgA).
491451

src/content/reference/react-dom/createPortal.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ import { createPortal } from 'react-dom';
5050
5151
* `domNode`: DOM-вузол, наприклад повернутий з `document.getElementById()`. Переданий вузол вже повинен існувати. Передавання різних DOM-вузлів під час оновлення спричинить повторне створення контенту всередині порталу.
5252
53-
<<<<<<< HEAD
54-
* **опційний** `key`: Унікальна стрічкова або числова змінна, що використовується як [ключ](/learn/rendering-lists/#keeping-list-items-in-order-with-key) порталу.
55-
=======
56-
* **optional** `key`: A unique string or number to be used as the portal's [key.](/learn/rendering-lists#keeping-list-items-in-order-with-key)
57-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
53+
* **опційний** `key`: Унікальна стрічкова або числова змінна, що використовується як [ключ](/learn/rendering-lists#keeping-list-items-in-order-with-key) порталу.
5854
5955
#### Результат {/*returns*/}
6056

src/content/reference/react/index.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ React-dom contains features that are only supported for web applications (which
2929
* [Client APIs](/reference/react-dom/client) - The `react-dom/client` APIs let you render React components on the client (in the browser).
3030
* [Server APIs](/reference/react-dom/server) - The `react-dom/server` APIs let you render React components to HTML on the server.
3131

32-
<<<<<<< HEAD
33-
## Правила React {/*rules-of-react*/}
34-
=======
3532
## React Compiler {/*react-compiler*/}
3633

3734
The React Compiler is a build-time optimization tool that automatically memoizes your React components and values:
@@ -40,8 +37,7 @@ The React Compiler is a build-time optimization tool that automatically memoizes
4037
* [Directives](/reference/react-compiler/directives) - Function-level directives to control compilation.
4138
* [Compiling Libraries](/reference/react-compiler/compiling-libraries) - Guide for shipping pre-compiled library code.
4239

43-
## Rules of React {/*rules-of-react*/}
44-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
40+
## Правила React {/*rules-of-react*/}
4541

4642
React has idioms — or rules — for how to express patterns in a way that is easy to understand and yields high-quality applications:
4743

src/sidebarHome.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080
},
8181
{
8282
"hasSectionHeader": true,
83-
<<<<<<< HEAD
84-
"sectionHeader": "ДОЛУЧИТИСЯ"
85-
=======
8683
"sectionHeader": "REACT COMPILER API"
8784
},
8885
{
@@ -99,8 +96,7 @@
9996
},
10097
{
10198
"hasSectionHeader": true,
102-
"sectionHeader": "GET INVOLVED"
103-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
99+
"sectionHeader": "ДОЛУЧИТИСЯ"
104100
},
105101
{
106102
"title": "Спільнота React",

src/sidebarReference.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,6 @@
327327
},
328328
{
329329
"hasSectionHeader": true,
330-
<<<<<<< HEAD
331-
"sectionHeader": "Правила React"
332-
=======
333330
"sectionHeader": "React Compiler"
334331
},
335332
{
@@ -378,8 +375,7 @@
378375
},
379376
{
380377
"hasSectionHeader": true,
381-
"sectionHeader": "Rules of React"
382-
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
378+
"sectionHeader": "Правила React"
383379
},
384380
{
385381
"title": "Вступ",

0 commit comments

Comments
 (0)