Question from the React ⚛️ test

Write a React component that renders a list of numbers

Medium

What will this component display?

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

const MyComponent=()=>{
    const ComponentB=<ComponentA value={1}/>
    return(
       <>
           <ComponentA value={- 1}/>
           <ComponentB/>
       </>
    );
};
Author: EnguerranStatus: Published(Update)Question passed 453 times
Edit
1
Community Evaluations
developer avatar
Vincent Cotro
03/11/2023
Merci Enguerran, c'est effectivement plus clair !