Question from the React ⚛️ test

Fix the useMemo hook in this React component.

Medium
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: PublishedQuestion passed 3758 times
Edit
4
Community Evaluations
developer avatar
Spelling / formatting error
Hanane
08/01/2024
toUppercase() => toUpperCase()
developer avatar
Ambiguous
Nice Alligator
08/07/2024
wrong answer to the question
developer avatar
Константин
13/08/2023
Bad question with wrong answer