{"action":"closed","issue":{"url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/187","repository_url":"https://api.github.com/repos/PaulLeCam/react-leaflet","labels_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/187/comments","events_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/187/events","html_url":"https://github.com/PaulLeCam/react-leaflet/issues/187","id":164087432,"number":187,"title":"Issues navigating away from map with multiple base layers","user":{"login":"dkrichards86","id":10285723,"avatar_url":"https://avatars.githubusercontent.com/u/10285723?v=3","gravatar_id":"","url":"https://api.github.com/users/dkrichards86","html_url":"https://github.com/dkrichards86","followers_url":"https://api.github.com/users/dkrichards86/followers","following_url":"https://api.github.com/users/dkrichards86/following{/other_user}","gists_url":"https://api.github.com/users/dkrichards86/gists{/gist_id}","starred_url":"https://api.github.com/users/dkrichards86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkrichards86/subscriptions","organizations_url":"https://api.github.com/users/dkrichards86/orgs","repos_url":"https://api.github.com/users/dkrichards86/repos","events_url":"https://api.github.com/users/dkrichards86/events{/privacy}","received_events_url":"https://api.github.com/users/dkrichards86/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-06T14:20:59Z","updated_at":"2016-07-08T18:26:36Z","closed_at":"2016-07-08T18:26:35Z","body":"Please make sure to check the following boxes before submitting an issue. Thanks!\r\n\r\n- [x] Check that all peer dependencies are installed: React, ReactDOM and Leaflet.\r\n- [x] Check that you are using a supported version of React (v0.14 or v15).\r\n- [x] Check that you are using a supported version of Leaflet (v.0.7)\r\n- [x] Make sure you have followed the [quick start guide](http://leafletjs.com/examples/quick-start.html) for Leaflet.\r\n- [x] Make sure you have fully read the [documentation](https://github.com/PaulLeCam/react-leaflet/blob/master/README.md) and that you understand the [technical considerations](https://github.com/PaulLeCam/react-leaflet/blob/master/README.md#technical-considerations).\r\n\r\n### Expected behavior\r\nUser navigates from map view to another view without issue.\r\n\r\n### Actual behavior\r\nWhen attempting to navigate away from a map with multiple base layers, I am seeing ```Uncaught TypeError: Cannot read property 'hasLayer' of null```.  I'm using Leaflet 0.7.7, React 15.1.0 and React-Leaflet 0.12.0.\r\n\r\nStack Trace:\r\n```javascript\r\no.Control.Layers.o.Control.extend._addItem\t@\tleaflet.js:9\r\no.Control.Layers.o.Control.extend._update\t@\tleaflet.js:9\r\no.Control.Layers.o.Control.extend.removeLayer\t@\tleaflet.js:9\r\nremoveLayerControl\t@\treact-leaflet.js:3997\r\ncomponentWillUnmount\t@\treact-leaflet.js:3860\r\n```\r\n\r\nIf I only use one BaseLayer, everything behaves as expected.  The map works as expected until changing views.\r\n\r\nThis issue seems related to #145.\r\n\r\n### Steps to reproduce\r\nSee [jsfiddle](https://jsfiddle.net/dkrichards86/dv0j9ac0/).\r\n"}}
{"actor":{"display_login":"dkrichards86"}}