0

I use this code when make a request to server. Inside request function i do this:

const menu = this.props.location.state.menuItemDishesMap; //get Map() value from props
const order = {
  person: { id: 1 },
  menuItemDishMap: menu, //pass it to order object that goes to server
};

console.log(order); //make sure that my Map() object went to server

This is what console.log() says:

console.log

But, when I see developer tools, this Map() is always empty.

developer tools

Have no idea why. Thanks for any help

connexo
  • 53,704
  • 14
  • 91
  • 128
Robert
  • 59
  • 2
  • 2
  • 7
  • 1
    Please show us how you are sending the request. – Bergi Apr 28 '20 at 17:52
  • @connexo Actually I was pretty sure it would turn out to be a duplicate of [How do you JSON.stringify an ES6 Map?](https://stackoverflow.com/q/29085197/1048572). There's definitely no async code in the question. – Bergi Apr 28 '20 at 17:54
  • this is answer: https://stackoverflow.com/a/54140811/13334444 thanks everybody! – Robert Apr 28 '20 at 18:07

0 Answers0