diff --git a/src/content/learn/sharing-state-between-components.md b/src/content/learn/sharing-state-between-components.md
index 149164fe1..e7c502af6 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: Partager l'état entre des composants
---
-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.
+Vous souhaitez parfois que les états de deux composants changent toujours ensemble. Pour ça, retirez leurs états et fusionnez-les dans leur plus proche parent commun, puis passez-leur ces données *via* les props. C'est ce qu'on appelle *faire remonter l'état*, et c'est l'une des choses les plus communes que vous ferez en écrivant du code React.
-- How to share state between components by lifting it up
-- What are controlled and uncontrolled components
+- Comment partager l'état entre composants en le faisant remonter
+- Ce que sont les composants contrôlés et non contrôlés
-## Lifting state up by example {/*lifting-state-up-by-example*/}
+## Faire remonter l'état par l'exemple {/*lifting-state-up-by-example*/}
-In this example, a parent `Accordion` component renders two separate `Panel`s:
+Dans cet exemple, un composant parent `Accordion` affiche deux `Panel` distincts :
* `Accordion`
- `Panel`
- `Panel`
-Each `Panel` component has a boolean `isActive` state that determines whether its content is visible.
+Chaque composant `Panel` a une variable d'état booléenne `isActive` qui définit si le contenu du panneau est visible ou non.
-Press the Show button for both panels:
+Appuyez sur le bouton Afficher pour les deux panneaux :
@@ -41,7 +41,7 @@ function Panel({ title, children }) {
-
+
+ Avec une population d'environ 2 millions d'habitants, Almaty est la plus grande ville du Kazakhstan. Elle en était la capitale 1929 à 1997.
With a population of about 2 million, Almaty is Kazakhstan's largest city. From 1929 to 1997, it was its capital city.
-
- 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.
+
+ Le nom vient de алма, le mot kazakh pour « pomme » ; il est souvent traduit par « pleine de pommes ». En fait, la région entourant Almaty est considérée comme le berceau ancestral de la pomme, et la Malus sieversii sauvage est considérée comme une probable candidate pour être l'ancêtre de la pomme domestique moderne.
>
);
@@ -73,59 +74,59 @@ h3, p { margin: 5px 0px; }
-Notice how pressing one panel's button does not affect the other panel--they are independent.
+Constatez que le fait d'appuyer sur le bouton d'un des panneaux n'affecte pas l'affichage de l'autre panneau : ils sont indépendants.
-
+
-Initially, each `Panel`'s `isActive` state is `false`, so they both appear collapsed
+Initialement, l'état `isActive` de chaque `Panel` vaut `false`, ils apparaissent donc repliés.
-
+
-Clicking either `Panel`'s button will only update that `Panel`'s `isActive` state alone
+Le fait de cliquer sur le bouton d'un `Panel` ne met à jour que l'état `isActive` de ce `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?
+**Supposons maintenant que vous souhaitiez le modifier afin qu'un seul panneau soit déplié à la fois.** Avec cette conception, étendre le second panneau devrait replier le premier. Comment feriez-vous ça ?
-To coordinate these two panels, you need to "lift their state up" to a parent component in three steps:
+Afin de coordonner ces deux panneaux, vous devez « faire remonter leur état » jusqu'à un composant parent en trois étapes :
-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. **Retirez** les états des composants enfants.
+2. **Passez** des valeurs codées en dur depuis le parent commun.
+3. **Ajoutez** l'état au parent commun et passez-le aux enfants avec les gestionnaires d'événements.
-This will allow the `Accordion` component to coordinate both `Panel`s and only expand one at a time.
+Ça permettra au composant `Accordion` de coordonner les deux `Panel` et ainsi n'en déplier qu'un seul à la fois.
-### Step 1: Remove state from the child components {/*step-1-remove-state-from-the-child-components*/}
+### Étape 1 : retirez l'état des composants enfants {/*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:
+Vous donnerez le contrôle du `isActive` des `Panel` au composant parent. Ça signifie que le composant parent passera `isActive` aux `Panel` *via* les props. Commencez par **supprimer cette ligne** du composant `Panel` :
```js
const [isActive, setIsActive] = useState(false);
```
-And instead, add `isActive` to the `Panel`'s list of props:
+À la place, ajoutez `isActive` à la liste des props de `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!
+Désormais, le composant parent du `Panel` peut *contrôler* `isActive` en [le passant en tant que prop](/learn/passing-props-to-a-component). À l'inverse, le composant `Panel` *n'a plus le contrôle* sur la valeur de `isActive` — elle est désormais entre les mains du composant parent !
-### Step 2: Pass hardcoded data from the common parent {/*step-2-pass-hardcoded-data-from-the-common-parent*/}
+### Étape 2 : passez la valeur codée en dur depuis le parent commun {/*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:
+Pour faire remonter l'état, vous devez identifier le parent commun le plus proche des *deux* composants enfants que vous souhaitez coordonner :
-* `Accordion` *(closest common parent)*
+* `Accordion` *(parent commun le plus proche)*
- `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:
+Dans cet exemple, il s'agit du composant `Accordion`. Puisqu'il se situe au-dessus des deux panneaux et qu'il peut contrôler leurs props, il devient la « source de vérité » pour savoir quel panneau est actuellement actif. Faites en sorte que le composant `Accordion` passe la valeur codée en dur de `isActive` (par exemple `true`) aux deux panneaux :
@@ -136,11 +137,11 @@ 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.
+
+ Avec une population d'environ 2 millions d'habitants, Almaty est la plus grande ville du Kazakhstan. De 1929 à 1997, elle en a été la capitale.
-
- 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.
+
+ Le nom vient de алма, le mot kazakh pour « pomme » ; il est souvent traduit par « pleine de pommes ». En fait, la région entourant Almaty est considérée comme le berceau ancestral de la pomme, et la Malus sieversii sauvage est considérée comme une probable candidate pour être l'ancêtre de la pomme domestique moderne.
>
);
@@ -154,7 +155,7 @@ function Panel({ title, children, isActive }) {
{children}
) : (
)}
@@ -172,21 +173,21 @@ h3, p { margin: 5px 0px; }
-Try editing the hardcoded `isActive` values in the `Accordion` component and see the result on the screen.
+Modifiez les valeurs de `isActive` codées en dur dans le composant `Accordion` et voyez le résultat à l'écran.
-### Step 3: Add state to the common parent {/*step-3-add-state-to-the-common-parent*/}
+### Étape 3 : ajoutez l'état au parent commun {/*step-3-add-state-to-the-common-parent*/}
-Lifting state up often changes the nature of what you're storing as state.
+Faire remonter l'état change souvent la nature de ce que vous y stockez.
-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:
+Dans cet exemple, un seul panneau doit être actif à un instant donné. Ça signifie que le parent commun `Accordion` doit garder trace de *quel* panneau est actif. Pour la variable d'état, il pourrait utiliser un nombre représentant l'index du `Panel` actif plutôt qu'un `boolean` :
```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.
+Quand `activeIndex` vaut `0`, le premier panneau est actif, et quand il vaut `1`, alors c'est le second.
-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):
+Le fait d'appuyer sur le bouton « Afficher » dans l'un ou l'autre des `Panel` doit modifier l'index actif dans `Accordion`. Un `Panel` ne peut définir l'état `activeIndex` directement puisqu'il est défini à l'intérieur d'`Accordion`. Ce dernier doit *explicitement autoriser* le composant `Panel` à changer son état en [lui transmettant un gestionnaire d'événement en tant que prop](/learn/responding-to-events#passing-event-handlers-as-props) :
```js
<>
@@ -205,7 +206,7 @@ Clicking the "Show" button in either `Panel` needs to change the active index in
>
```
-The `