byeokim / gmailpush

Gmail API push notification handler for Node.js
MIT License
53 stars 7 forks source link

google-map-react-examples/src/examples/MarkerInfoWindow.js #3

Closed ingridlar closed 4 years ago

byeokim commented 4 years ago

What were the values of myPlaces and index at line 137?

state.myPlaces.findIndex(e => e.id === key) will return -1 if there is no element whose id property has value equal to key. And state.myPlaces[-1] will return undefined.

By the way as I mentioned you would be better to post this issue on google-map-react-examples.

byeokim commented 4 years ago

I cloned your repository and ran the app, but couldn't reproduce your issue.

byeokim commented 4 years ago

I had cloned before you commited your lastest code. Now I cloned again. Here is the solution:

  1. Add this.state. to myPlaces at line 193 in App.js.
// before: {myPlaces.map(place => (
{this.state.myPlaces.map(place => (
  1. Move data.json to public directory.
  2. For data.json, wrap value of id with double quotes, e.g. "id": 1 to "id": "1"