Question from the React ⚛️ test

Write a React component that displays the name of the current user.

Medium

What will this component display and what can we say about index ?

const MyComponent=({index})=>{
    const [myName, setMyName]= useState('');
    const myMemoisedName= useMemo(()=>`${myName}`,[]);
    useEffect(()=>setMyName('W3D'));

    return<div>{myMemoisedName}</div>;
};
Author: Vincent CotroStatus: Published(Update)Question passed 180 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!