Question from the React ⚛️ test

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

Archived

What will this component display?

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

    return<div>{myMemoisedName}</div>;
};
Author: Vincent CotroStatus: Archived(New question!)Question passed 1878 times
-4
Community EvaluationsNo one has reviewed this question yet, be the first!