I am trying to do a dropdown menu in javascript where get all states from a function and show in the drop down menu. But the code that I have so far is showing my list wrong. Every state is next to each other instead of inside the drop down menu.
menu.js
export default function DropDownMenu(props){
if(!props.states) return
return(
<table>
<body>
{props.states.map(states=>
<select>
<option>{states.state}</option>
</select>)}
</body>
</table>
)
}
What is showing:
