Question from the React ⚛️ test

Fix the useMemo hook in this React component.

Archived
const SomeComponent=({name, firstName})=>{
    if(!name){
        return null;
    }
    
    const uppercaseName= useMemo(()=>firstName.toUpperCase(),[]);
    return<span>${`${name} ${uppercaseName}`}</span>;
};

What are the issues with this code?

Author: Clément DEVOSStatus: ArchivedQuestion passed 4086 times
5
Community EvaluationsNo one has reviewed this question yet, be the first!