Question du test React ⚛️

Écrire un composant React qui affiche une liste de nombres

Intermédiaire

Que va afficher ce composant ?

const ComponentA = ({ value }) => <div>{value + 1}</div>;

const MyComponent = () => {
    const ComponentB = <ComponentA value={1} />
    return (
        <>
            <ComponentA value={-1}/>
            <ComponentB />
        </>
    );
};
Auteur: EnguerranStatut : Publiée(Mise à jour)Question passée 231 fois
Modifier
0
Évaluations de la communauté
developer avatar
Vincent Cotro
03/11/2023
Merci Enguerran, c'est effectivement plus clair !