Skip to content

Commit b303365

Browse files
committed
feat: start translating
1 parent fa3f0cc commit b303365

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/content/learn/sharing-state-between-components.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
---
2-
title: Sharing State Between Components
2+
title: Спільний доступ до стану між компонентами
33
---
44

55
<Intro>
66

7-
Sometimes, you want the state of two components to always change together. To do it, remove state from both of them, move it to their closest common parent, and then pass it down to them via props. This is known as *lifting state up,* and it's one of the most common things you will do writing React code.
7+
Інколи ви хочете, щоб стан двох компонентів завжди змінювався разом. Щоб так зробити, видаліть стан з обох компонентів, перенесіть його до їхнього найближчого спільного батька та потім передайте його вниз до них завдяки пропсам. Це відоме як *підняття стану вгору* і це одна з найпоширеніших речей, які ви будете робити під час написання React коду.
88

99
</Intro>
1010

1111
<YouWillLearn>
1212

13-
- How to share state between components by lifting it up
14-
- What are controlled and uncontrolled components
13+
- Як поширювати стан між компонент підняттям його вгору
14+
- Що таке контрольовані та не контрольовані компоненти
1515

1616
</YouWillLearn>
1717

18-
## Lifting state up by example {/*lifting-state-up-by-example*/}
18+
## Підняття стану на прикладі {/*lifting-state-up-by-example*/}
1919

20-
In this example, a parent `Accordion` component renders two separate `Panel`s:
20+
В цьому прикладі, батьківський `Accordion` компонента рендерить дві окремі `Panel`і:
2121

2222
* `Accordion`
2323
- `Panel`
2424
- `Panel`
2525

26-
Each `Panel` component has a boolean `isActive` state that determines whether its content is visible.
26+
Кожна `Panel` компонента має булевий `isActive` стан, що визначає чи її вміст видимий.
2727

28-
Press the Show button for both panels:
28+
Натисніть кнопку Показати для обох панелей:
2929

3030
<Sandpack>
3131

@@ -41,7 +41,7 @@ function Panel({ title, children }) {
4141
<p>{children}</p>
4242
) : (
4343
<button onClick={() => setIsActive(true)}>
44-
Show
44+
Показати
4545
</button>
4646
)}
4747
</section>
@@ -51,12 +51,12 @@ function Panel({ title, children }) {
5151
export default function Accordion() {
5252
return (
5353
<>
54-
<h2>Almaty, Kazakhstan</h2>
55-
<Panel title="About">
56-
With a population of about 2 million, Almaty is Kazakhstan's largest city. From 1929 to 1997, it was its capital city.
54+
<h2>Алмати, Казахстан</h2>
55+
<Panel title="Про Алмати">
56+
Із населенням близько 2 мільйонів, Алмати є найбільшим містом в Казахстані. З 1929 по 1997, воно було його столицею.
5757
</Panel>
58-
<Panel title="Etymology">
59-
The name comes from <span lang="kk-KZ">алма</span>, the Kazakh word for "apple" and is often translated as "full of apples". In fact, the region surrounding Almaty is thought to be the ancestral home of the apple, and the wild <i lang="la">Malus sieversii</i> is considered a likely candidate for the ancestor of the modern domestic apple.
58+
<Panel title="Етимологія">
59+
Назва походить від казахського слова <span lang="kk-KZ">алма</span>, що означає "яблуко" і часто перекладалось як "повний яблук". Насправді, регіон що оточує Алмати вважається прабатьківщиною яблука, і дика <i lang="la">Malus sieversii</i> вважається ймовірним кандидатом на предка сучасного домашнього яблука.
6060
</Panel>
6161
</>
6262
);

0 commit comments

Comments
 (0)