{"action":"opened","issue":{"url":"https://api.github.com/repos/mapbox/react-native-mapbox-gl/issues/304","repository_url":"https://api.github.com/repos/mapbox/react-native-mapbox-gl","labels_url":"https://api.github.com/repos/mapbox/react-native-mapbox-gl/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/react-native-mapbox-gl/issues/304/comments","events_url":"https://api.github.com/repos/mapbox/react-native-mapbox-gl/issues/304/events","html_url":"https://github.com/mapbox/react-native-mapbox-gl/issues/304","id":140745330,"number":304,"title":"Fix exporting style","user":{"login":"tmcw","id":32314,"avatar_url":"https://avatars.githubusercontent.com/u/32314?v=3","gravatar_id":"","url":"https://api.github.com/users/tmcw","html_url":"https://github.com/tmcw","followers_url":"https://api.github.com/users/tmcw/followers","following_url":"https://api.github.com/users/tmcw/following{/other_user}","gists_url":"https://api.github.com/users/tmcw/gists{/gist_id}","starred_url":"https://api.github.com/users/tmcw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmcw/subscriptions","organizations_url":"https://api.github.com/users/tmcw/orgs","repos_url":"https://api.github.com/users/tmcw/repos","events_url":"https://api.github.com/users/tmcw/events{/privacy}","received_events_url":"https://api.github.com/users/tmcw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-14T17:43:29Z","updated_at":"2016-03-14T17:43:29Z","closed_at":null,"body":"A general 'desired refactoring backlog'\r\n\r\n**Stop calling the map Mapbox**\r\n\r\nWe do this in example https://github.com/mapbox/react-native-mapbox-gl/blob/master/ios/example.js#L157 - we shouldn't. Mapbox is not a map view. Call this a map view.\r\n\r\n**Stop abusing mixins**\r\n\r\nThere's no sense in throwing [random values into a mixin just to get them to a component](https://github.com/mapbox/react-native-mapbox-gl/blob/master/ios/example.js#L166): stop doing that.\r\n\r\n**Make annotations and other APIs idempotent**\r\n\r\nWe [pass an annotations prop to the map view](https://github.com/mapbox/react-native-mapbox-gl/blob/master/ios/example.js#L172) but then [call methods that changes it in place](https://github.com/mapbox/react-native-mapbox-gl/blob/master/ios/example.js#L116). This goes against the flow of React in general: props and state should define the application, not imperative function calls.\r\n\r\nStrawman example of how we might structure our exports:\r\n\r\n```js\r\nvar { MapView, mapStyles } = require('react-native-mapbox-gl');\r\n```\r\n\r\ncc @bsudekum "}}