new Map() collection in react state

JavaScript
{this.state.data.map((person) => <TableRow key = {shortid.generate()} data = {person} />)}function MapComponent(){
  const [myMap, setMyMap] = useState(new Map());
  const updateMap = (k,v) => {
    setMyMap(new Map(myMap.set(k,v)));
  }
  return(
    <ul>
      {[...myMap.keys()].map(k => (
        <li key={k}>myMap.get(k)</li>
      ))}
    </ul>
  );
}
Source

Also in JavaScript: