In my case it is happened due to curly braces of function if you use jsx then you need to change curly braces to Parentheses, see below code
const [countries] = useState(["USA", "UK", "BD"])
I tried this but not work, don't know why
{countries.map((country) => {
<MenuItem value={country}>{country}</MenuItem>
})}
But when I change Curly Braces to parentheses and Its working fine for me
{countries.map((country) => ( //Changes is here instead of {
<MenuItem value={country}>{country}</MenuItem>
))} //and here instead of }
Hopefully it will help you too...