{"action":"closed","issue":{"url":"https://api.github.com/repos/tomchentw/react-google-maps/issues/141","labels_url":"https://api.github.com/repos/tomchentw/react-google-maps/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/tomchentw/react-google-maps/issues/141/comments","events_url":"https://api.github.com/repos/tomchentw/react-google-maps/issues/141/events","html_url":"https://github.com/tomchentw/react-google-maps/issues/141","id":115601498,"number":141,"title":"Fix for eslint error \"Do not use setState in componentDidMount       react/no-did-mount-set-state\"","user":{"login":"stevus","id":1261603,"avatar_url":"https://avatars.githubusercontent.com/u/1261603?v=3","gravatar_id":"","url":"https://api.github.com/users/stevus","html_url":"https://github.com/stevus","followers_url":"https://api.github.com/users/stevus/followers","following_url":"https://api.github.com/users/stevus/following{/other_user}","gists_url":"https://api.github.com/users/stevus/gists{/gist_id}","starred_url":"https://api.github.com/users/stevus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevus/subscriptions","organizations_url":"https://api.github.com/users/stevus/orgs","repos_url":"https://api.github.com/users/stevus/repos","events_url":"https://api.github.com/users/stevus/events{/privacy}","received_events_url":"https://api.github.com/users/stevus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tomchentw/react-google-maps/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/tomchentw/react-google-maps/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-06T22:15:11Z","updated_at":"2015-11-22T04:20:36Z","closed_at":"2015-11-22T04:20:36Z","body":"In [L81 (and other map/components})](https://github.com/tomchentw/react-google-maps/blob/master/src/GoogleMap.js#L81):\r\n\r\nshould be instead:\r\n```\r\ncomponentWillReceiveProps (nextProps) {\r\n\r\n    if(typeof this.state.map === 'undefined') {\r\n        const domEl = findDOMNode(this);\r\n        const {containerTagName, containerProps, children, ...mapProps} = nextProps;\r\n        const map = GoogleMapHolder._createMap(domEl, mapProps);\r\n        this.setState({ map });\r\n    }\r\n}\r\n```\r\n\r\notherwise will fail ES2015 eslinting\r\n\r\n```\r\nerror  Do not use setState in componentDidMount       react/no-did-mount-set-state\r\n```"}}