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 3450 times
Edit
5
Community Evaluations
developer avatar
Spelling / formatting error
Hanane
08/01/2024
toUppercase() => toUpperCase()
developer avatar
Константин
13/08/2023
Bad question with wrong answer