diff --git a/src/content/learn/sharing-state-between-components.md b/src/content/learn/sharing-state-between-components.md
index 149164fe1..020ee6a78 100644
--- a/src/content/learn/sharing-state-between-components.md
+++ b/src/content/learn/sharing-state-between-components.md
@@ -1,31 +1,31 @@
---
-title: Sharing State Between Components
+title: Compartilhando State Entre Componentes
---
-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.
+Às vezes, você deseja que o state de dois componentes seja sempre alterado em conjunto. Para fazer isso, remova o state de ambos, mova-os para o pai comum mais próximo e, em seguida, passe-os aos componentes por meio de props. Isto é conhecido como *elevação de state* e é uma das coisas mais comuns que você fará ao escrever código React.
-- How to share state between components by lifting it up
-- What are controlled and uncontrolled components
+- Como compartilhar state entre componentes por sua elevação
+- O que são componentes controlados e não controlados
-## Lifting state up by example {/*lifting-state-up-by-example*/}
+## Exemplificando a elevação de state {/*lifting-state-up-by-example*/}
-In this example, a parent `Accordion` component renders two separate `Panel`s:
+Neste exemplo, um componente `Accordion` pai renderiza dois componentes `Panel` separados:
* `Accordion`
- `Panel`
- `Panel`
-Each `Panel` component has a boolean `isActive` state that determines whether its content is visible.
+Cada componente `Panel` tem um state booleano `isActive` que determina se o seu conteúdo está visível.
-Press the Show button for both panels:
+Pressione o botão "Show" de ambos os painéis:
@@ -51,12 +51,12 @@ function Panel({ title, children }) {
export default function Accordion() {
return (
<>
-
Almaty, Kazakhstan
-
- With a population of about 2 million, Almaty is Kazakhstan's largest city. From 1929 to 1997, it was its capital city.
+
Almaty, Cazaquistão
+
+ Com uma população de cerca de 2 milhões de habitantes, Almaty é a maior cidade do Cazaquistão. De 1929 a 1997, foi sua capital.
-
- The name comes from алма, 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 Malus sieversii is considered a likely candidate for the ancestor of the modern domestic apple.
+
+ O nome vem de алма, a palavra cazaque para "maçã", e é frequentemente traduzido como "cheio de maçãs". De fato, acredita-se que a região em torno de Almaty seja o lar ancestral da maçã, e o Malus sieversii selvagem é considerado um provável candidato a ancestral da maçã doméstica moderna.
>
);
@@ -73,59 +73,59 @@ h3, p { margin: 5px 0px; }
-Notice how pressing one panel's button does not affect the other panel--they are independent.
+Observe como o fato de pressionar o botão de um painel não afeta o outro painel--eles são independentes.
-
+
-Initially, each `Panel`'s `isActive` state is `false`, so they both appear collapsed
+Inicialmente, o state `isActive` de cada `Panel` é falso, de modo que ambos aparecem recolhidos
-
+
-Clicking either `Panel`'s button will only update that `Panel`'s `isActive` state alone
+Clicar em um dos botões do `Panel` somente atualizará o state `isActive` desse `Panel`.
-**But now let's say you want to change it so that only one panel is expanded at any given time.** With that design, expanding the second panel should collapse the first one. How would you do that?
+**Mas agora digamos que você queira alterá-lo para que apenas um painel seja expandido por vez.** Com esse design, expandir o segundo painel deve recolher o primeiro. Como você faria isso?
-To coordinate these two panels, you need to "lift their state up" to a parent component in three steps:
+Para coordenar esses dois painéis, você precisa "elevar o state deles" para um componente pai em três etapas:
-1. **Remove** state from the child components.
-2. **Pass** hardcoded data from the common parent.
-3. **Add** state to the common parent and pass it down together with the event handlers.
+1. **Remover** o state dos componentes filhos.
+2. **Passar** dados estáticos do pai comum.
+3. **Adicionar** o state ao pai comum e passá-lo para baixo junto com os manipuladores de eventos.
-This will allow the `Accordion` component to coordinate both `Panel`s and only expand one at a time.
+Isso permitirá que o componente `Accordion` coordene ambos os `Panel`s e expanda apenas um de cada vez.
-### Step 1: Remove state from the child components {/*step-1-remove-state-from-the-child-components*/}
+### Etapa 1: Remover o state dos componentes filhos {/*step-1-remove-state-from-the-child-components*/}
-You will give control of the `Panel`'s `isActive` to its parent component. This means that the parent component will pass `isActive` to `Panel` as a prop instead. Start by **removing this line** from the `Panel` component:
+Você dará o controle do `isActive` do `Panel` ao seu componente pai. Isso significa que o componente pai passará o `isActive` para o `Panel` como uma propriedade. Comece **removendo essa linha** do componente `Panel`:
```js
const [isActive, setIsActive] = useState(false);
```
-And instead, add `isActive` to the `Panel`'s list of props:
+Em vez disso, adicione `isActive` à lista de props do `Panel`:
```js
function Panel({ title, children, isActive }) {
```
-Now the `Panel`'s parent component can *control* `isActive` by [passing it down as a prop.](/learn/passing-props-to-a-component) Conversely, the `Panel` component now has *no control* over the value of `isActive`--it's now up to the parent component!
+Agora, o componente pai do `Panel` pode *controlar* o `isActive` [transmitindo-o como uma prop.](/learn/passing-props-to-a-component) Por outro lado, o componente `Panel` agora não tem *nenhum controle* sobre o valor de `isActive`; isso agora depende do componente pai!
-### Step 2: Pass hardcoded data from the common parent {/*step-2-pass-hardcoded-data-from-the-common-parent*/}
+### Etapa 2: passar dados estáticos do pai comum {/*step-2-pass-hardcoded-data-from-the-common-parent*/}
-To lift state up, you must locate the closest common parent component of *both* of the child components that you want to coordinate:
+Para elevar o state, você deve localizar o componente pai comum mais próximo de *ambos* os componentes filhos que deseja coordenar:
-* `Accordion` *(closest common parent)*
+* `Accordion` *(pai comum mais próximo)*
- `Panel`
- `Panel`
-In this example, it's the `Accordion` component. Since it's above both panels and can control their props, it will become the "source of truth" for which panel is currently active. Make the `Accordion` component pass a hardcoded value of `isActive` (for example, `true`) to both panels:
+Neste exemplo, é o componente `Accordion`. Como ele está acima de ambos os painéis e pode controlar suas props, ele se tornará a "fonte da verdade" para saber qual painel está ativo no momento. Faça com que o componente `Accordion` passe um valor estático de `isActive` (por exemplo, `true`) para ambos os painéis:
@@ -135,12 +135,12 @@ import { useState } from 'react';
export default function Accordion() {
return (
<>
-
Almaty, Kazakhstan
-
- With a population of about 2 million, Almaty is Kazakhstan's largest city. From 1929 to 1997, it was its capital city.
+
Almaty, Cazaquistão
+
+ Com uma população de cerca de 2 milhões de habitantes, Almaty é a maior cidade do Cazaquistão. De 1929 a 1997, foi sua capital.
-
- The name comes from алма, 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 Malus sieversii is considered a likely candidate for the ancestor of the modern domestic apple.
+
+ O nome vem de алма, a palavra cazaque para "maçã", e é frequentemente traduzido como "cheio de maçãs". De fato, acredita-se que a região em torno de Almaty seja o lar ancestral da maçã, e o Malus sieversii selvagem é considerado um provável candidato a ancestral da maçã doméstica moderna.
>
);
@@ -154,7 +154,7 @@ function Panel({ title, children, isActive }) {
{children}
) : (
)}
@@ -172,21 +172,21 @@ h3, p { margin: 5px 0px; }
-Try editing the hardcoded `isActive` values in the `Accordion` component and see the result on the screen.
+Tente editar os valores estáticos `isActive` no componente `Accordion` e veja o resultado na tela.
-### Step 3: Add state to the common parent {/*step-3-add-state-to-the-common-parent*/}
+### Etapa 3: Adicionar state ao pai comum {/*step-3-add-state-to-the-common-parent*/}
-Lifting state up often changes the nature of what you're storing as state.
+Elevar o state muitas vezes muda a natureza do que você está armazenando como state.
-In this case, only one panel should be active at a time. This means that the `Accordion` common parent component needs to keep track of *which* panel is the active one. Instead of a `boolean` value, it could use a number as the index of the active `Panel` for the state variable:
+Nesse caso, apenas um painel deve estar ativo por vez. Isso significa que o componente pai comum `Accordion` precisa manter o controle de *qual* painel está ativo. Em vez de um valor `booleano`, ele poderia usar um número como índice do `Panel` ativo para a variável do state:
```js
const [activeIndex, setActiveIndex] = useState(0);
```
-When the `activeIndex` is `0`, the first panel is active, and when it's `1`, it's the second one.
+Quando o `activeIndex` é `0`, o primeiro painel está ativo, e quando é `1`, é o segundo.
-Clicking the "Show" button in either `Panel` needs to change the active index in `Accordion`. A `Panel` can't set the `activeIndex` state directly because it's defined inside the `Accordion`. The `Accordion` component needs to *explicitly allow* the `Panel` component to change its state by [passing an event handler down as a prop](/learn/responding-to-events#passing-event-handlers-as-props):
+Clicar no botão "Exibir" em um dos "Painéis" precisa alterar o índice ativo no "Accordion". Um `Panel` não pode definir o state `activeIndex` diretamente porque ele é definido dentro do `Accordion`. O componente `Accordion` precisa *permitir explicitamente* que o componente `Panel` altere seu state, [passando um manipulador de eventos como uma prop](/learn/responding-to-events#passing-event-handlers-as-props):
```js
<>
@@ -205,7 +205,7 @@ Clicking the "Show" button in either `Panel` needs to change the active index in
>
```
-The `