diff --git a/docs/advanced/custom-components.md b/docs/advanced/custom-components.md index 04e052a0..788a3500 100644 --- a/docs/advanced/custom-components.md +++ b/docs/advanced/custom-components.md @@ -10,7 +10,7 @@ all extend the `BaseControl` React component. You may also create your own map c The following component renders a label "(longitude, latitude)" at the given coordinate: ```js -import React from 'react'; +import * as React from 'react'; import {BaseControl} from 'react-map-gl'; class CustomMarker extends BaseControl { diff --git a/docs/advanced/custom-overlays.md b/docs/advanced/custom-overlays.md index 775635e6..58211ffe 100644 --- a/docs/advanced/custom-overlays.md +++ b/docs/advanced/custom-overlays.md @@ -5,7 +5,7 @@ resuable overlays that others can include into their project. Overlays can acces the current viewport through the React [context](https://facebook.github.io/react/docs/context.html): ```js -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import {BaseControl} from 'react-map-gl'; diff --git a/docs/api-reference/geolocate-control.md b/docs/api-reference/geolocate-control.md index 31a0f09c..57da3948 100644 --- a/docs/api-reference/geolocate-control.md +++ b/docs/api-reference/geolocate-control.md @@ -5,7 +5,8 @@ This is a React equivalent of Mapbox's [GeolocateControl](https://www.mapbox.com/mapbox-gl-js/api/#geolocatecontrol). ```js -import React, { Component } from "react"; +import * as React from 'react'; +import { Component } from "react"; import ReactMapGL, {GeolocateControl} from "react-map-gl"; class Map extends Component { diff --git a/docs/api-reference/layer.md b/docs/api-reference/layer.md index 2cbd35f2..1aeb0934 100644 --- a/docs/api-reference/layer.md +++ b/docs/api-reference/layer.md @@ -5,7 +5,7 @@ This component allows apps to create a [map layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers) using React. ```js -import React from 'react'; +import * as React from 'react'; import ReactMapGL, {Layer} from 'react-map-gl'; const parkLayer = { diff --git a/docs/api-reference/marker.md b/docs/api-reference/marker.md index 821be19d..cb40742c 100644 --- a/docs/api-reference/marker.md +++ b/docs/api-reference/marker.md @@ -26,7 +26,8 @@ class Map extends Component { Performance notes: if a large number of markers are needed, it's generally favorable to cache the `` nodes, so that we don't rerender them when the viewport changes. ```js -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; import ReactMapGL, {Marker} from 'react-map-gl'; const CITIES = [...]; diff --git a/docs/api-reference/navigation-control.md b/docs/api-reference/navigation-control.md index b82215c2..c2a2db07 100644 --- a/docs/api-reference/navigation-control.md +++ b/docs/api-reference/navigation-control.md @@ -6,7 +6,8 @@ This is a React equivalent of Mapbox's [NavigationControl](https://www.mapbox.co which provides zoom buttons and a compass button. ```js -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import ReactMapGL, {NavigationControl} from 'react-map-gl'; class Map extends Component { diff --git a/docs/api-reference/source.md b/docs/api-reference/source.md index 3a1c2d68..d8683e83 100644 --- a/docs/api-reference/source.md +++ b/docs/api-reference/source.md @@ -5,7 +5,7 @@ This component allows apps to create a [map source](https://docs.mapbox.com/mapbox-gl-js/style-spec/#sources) using React. It may contain [Layer](/docs/api-reference/layer.md) components as children. ```js -import React from 'react'; +import * as React from 'react'; import ReactMapGL, {Source, Layer} from 'react-map-gl'; const geojson = { diff --git a/docs/get-started/get-started.md b/docs/get-started/get-started.md index add5a66b..ea5acf24 100644 --- a/docs/get-started/get-started.md +++ b/docs/get-started/get-started.md @@ -12,7 +12,8 @@ npm install --save react-map-gl ## Example ```js -import React, { useState } from 'react'; +import * as React from 'react'; +import { useState } from 'react'; import ReactMapGL from 'react-map-gl'; function Map() { diff --git a/examples/additional-overlays/src/app.js b/examples/additional-overlays/src/app.js index 275c8438..5d3e7788 100644 --- a/examples/additional-overlays/src/app.js +++ b/examples/additional-overlays/src/app.js @@ -19,8 +19,9 @@ // THE SOFTWARE. /* global document, window */ -import ReactDOM from 'react-dom'; -import React, {Component} from 'react'; +import * as ReactDOM from 'react-dom'; +import * as React from 'react'; +import {Component} from 'react'; import MapGL from 'react-map-gl'; import Immutable from 'immutable'; diff --git a/examples/additional-overlays/src/choropleth-overlay.js b/examples/additional-overlays/src/choropleth-overlay.js index 40de2354..3614ff20 100644 --- a/examples/additional-overlays/src/choropleth-overlay.js +++ b/examples/additional-overlays/src/choropleth-overlay.js @@ -17,7 +17,8 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; import PropTypes from 'prop-types'; import {extent} from 'd3-array'; import {scaleLinear} from 'd3-scale'; diff --git a/examples/additional-overlays/src/scatterplot-overlay.js b/examples/additional-overlays/src/scatterplot-overlay.js index 8064c84e..a11b0fe1 100644 --- a/examples/additional-overlays/src/scatterplot-overlay.js +++ b/examples/additional-overlays/src/scatterplot-overlay.js @@ -17,7 +17,8 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; import PropTypes from 'prop-types'; import Immutable from 'immutable'; diff --git a/examples/clusters/src/app.js b/examples/clusters/src/app.js index 7c502ffa..39218c6e 100644 --- a/examples/clusters/src/app.js +++ b/examples/clusters/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {Source, Layer} from 'react-map-gl'; diff --git a/examples/clusters/src/control-panel.js b/examples/clusters/src/control-panel.js index 3e987991..f75653a5 100644 --- a/examples/clusters/src/control-panel.js +++ b/examples/clusters/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; export default class ControlPanel extends PureComponent { render() { diff --git a/examples/controls/src/app.js b/examples/controls/src/app.js index ba5c53d3..b798061c 100644 --- a/examples/controls/src/app.js +++ b/examples/controls/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {Popup, NavigationControl, FullscreenControl, ScaleControl} from 'react-map-gl'; diff --git a/examples/controls/src/city-info.js b/examples/controls/src/city-info.js index 4082bc22..a98b9c6f 100644 --- a/examples/controls/src/city-info.js +++ b/examples/controls/src/city-info.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; export default class CityInfo extends PureComponent { render() { diff --git a/examples/controls/src/control-panel.js b/examples/controls/src/control-panel.js index 0717f908..562891d2 100644 --- a/examples/controls/src/control-panel.js +++ b/examples/controls/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; export default class ControlPanel extends PureComponent { render() { diff --git a/examples/controls/src/pins.js b/examples/controls/src/pins.js index 9efdea80..1ceacf92 100644 --- a/examples/controls/src/pins.js +++ b/examples/controls/src/pins.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; import {Marker} from 'react-map-gl'; const ICON = `M20.2,15.7L20.2,15.7c1.1-1.6,1.8-3.6,1.8-5.7c0-5.6-4.5-10-10-10S2,4.5,2,10c0,2,0.6,3.9,1.6,5.4c0,0.1,0.1,0.2,0.2,0.3 diff --git a/examples/custom-controller/src/app.js b/examples/custom-controller/src/app.js index e88f96b4..3097a7a2 100644 --- a/examples/custom-controller/src/app.js +++ b/examples/custom-controller/src/app.js @@ -1,5 +1,6 @@ /* global window */ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL from 'react-map-gl'; diff --git a/examples/custom-controller/src/control-panel.js b/examples/custom-controller/src/control-panel.js index 88cd21f5..9cd6b27a 100644 --- a/examples/custom-controller/src/control-panel.js +++ b/examples/custom-controller/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; const camelPattern = /(^|[A-Z])[a-z]*/g; diff --git a/examples/custom-cursor/src/app.js b/examples/custom-cursor/src/app.js index 4aa4a025..f425e852 100644 --- a/examples/custom-cursor/src/app.js +++ b/examples/custom-cursor/src/app.js @@ -1,5 +1,6 @@ /* global window */ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL from 'react-map-gl'; import ControlPanel from './control-panel'; diff --git a/examples/custom-cursor/src/control-panel.js b/examples/custom-cursor/src/control-panel.js index afd37bbe..2899321b 100644 --- a/examples/custom-cursor/src/control-panel.js +++ b/examples/custom-cursor/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; // Layer id patterns by category const layerSelector = { diff --git a/examples/deckgl-overlay/src/app.js b/examples/deckgl-overlay/src/app.js index bd3c2117..49154288 100644 --- a/examples/deckgl-overlay/src/app.js +++ b/examples/deckgl-overlay/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import DeckGL, {ArcLayer} from 'deck.gl'; import MapGL from 'react-map-gl'; diff --git a/examples/draggable-markers/src/app.js b/examples/draggable-markers/src/app.js index 55b95550..543bb661 100644 --- a/examples/draggable-markers/src/app.js +++ b/examples/draggable-markers/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {Marker, NavigationControl} from 'react-map-gl'; diff --git a/examples/draggable-markers/src/control-panel.js b/examples/draggable-markers/src/control-panel.js index 3e2ce0c8..75f10249 100644 --- a/examples/draggable-markers/src/control-panel.js +++ b/examples/draggable-markers/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; const eventNames = ['onDragStart', 'onDrag', 'onDragEnd']; diff --git a/examples/draggable-markers/src/pin.js b/examples/draggable-markers/src/pin.js index 805a31f6..0111b04c 100644 --- a/examples/draggable-markers/src/pin.js +++ b/examples/draggable-markers/src/pin.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; const ICON = `M20.2,15.7L20.2,15.7c1.1-1.6,1.8-3.6,1.8-5.7c0-5.6-4.5-10-10-10S2,4.5,2,10c0,2,0.6,3.9,1.6,5.4c0,0.1,0.1,0.2,0.2,0.3 c0,0,0.1,0.1,0.1,0.2c0.2,0.3,0.4,0.6,0.7,0.9c2.6,3.1,7.4,7.6,7.4,7.6s4.8-4.5,7.4-7.5c0.2-0.3,0.5-0.6,0.7-0.9 diff --git a/examples/draw-polygon/src/app.js b/examples/draw-polygon/src/app.js index 40f12248..83c87b9e 100644 --- a/examples/draw-polygon/src/app.js +++ b/examples/draw-polygon/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL from 'react-map-gl'; import {Editor, EditorModes} from 'react-map-gl-draw'; diff --git a/examples/draw-polygon/src/control-panel.js b/examples/draw-polygon/src/control-panel.js index 0293d5c9..a98e2b68 100644 --- a/examples/draw-polygon/src/control-panel.js +++ b/examples/draw-polygon/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; import area from '@turf/area'; export default class ControlPanel extends PureComponent { diff --git a/examples/filter/src/app.js b/examples/filter/src/app.js index 9fb79e2a..ea9e1bde 100644 --- a/examples/filter/src/app.js +++ b/examples/filter/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {Popup, Source, Layer} from 'react-map-gl'; import ControlPanel from './control-panel'; diff --git a/examples/filter/src/control-panel.js b/examples/filter/src/control-panel.js index 9b6856ea..af1dc37c 100644 --- a/examples/filter/src/control-panel.js +++ b/examples/filter/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; export default class ControlPanel extends PureComponent { render() { diff --git a/examples/geojson-animation/src/app.js b/examples/geojson-animation/src/app.js index 9fd76ff5..111dcfcf 100644 --- a/examples/geojson-animation/src/app.js +++ b/examples/geojson-animation/src/app.js @@ -1,5 +1,6 @@ /* global window */ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {Source, Layer} from 'react-map-gl'; diff --git a/examples/geojson-animation/src/control-panel.js b/examples/geojson-animation/src/control-panel.js index e2728f45..67a909e0 100644 --- a/examples/geojson-animation/src/control-panel.js +++ b/examples/geojson-animation/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; export default class ControlPanel extends PureComponent { render() { diff --git a/examples/geojson/src/app.js b/examples/geojson/src/app.js index 7b048588..98f6e275 100644 --- a/examples/geojson/src/app.js +++ b/examples/geojson/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {Source, Layer} from 'react-map-gl'; import ControlPanel from './control-panel'; diff --git a/examples/geojson/src/control-panel.js b/examples/geojson/src/control-panel.js index 23dd57cc..a77dddcc 100644 --- a/examples/geojson/src/control-panel.js +++ b/examples/geojson/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; export default class ControlPanel extends PureComponent { render() { diff --git a/examples/get-started/classic/app.js b/examples/get-started/classic/app.js index 2ea0dc54..a3e71ae3 100644 --- a/examples/get-started/classic/app.js +++ b/examples/get-started/classic/app.js @@ -1,5 +1,6 @@ /* global document */ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL from 'react-map-gl'; diff --git a/examples/get-started/hooks/app.js b/examples/get-started/hooks/app.js index eb74f6e4..80b4967e 100644 --- a/examples/get-started/hooks/app.js +++ b/examples/get-started/hooks/app.js @@ -1,5 +1,6 @@ /* global document */ -import React, {useState} from 'react'; +import * as React from 'react'; +import {useState} from 'react'; import {render} from 'react-dom'; import MapGL from 'react-map-gl'; diff --git a/examples/heatmap/src/app.js b/examples/heatmap/src/app.js index b4edc209..08710a1f 100644 --- a/examples/heatmap/src/app.js +++ b/examples/heatmap/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {Source, Layer} from 'react-map-gl'; import ControlPanel from './control-panel'; diff --git a/examples/heatmap/src/control-panel.js b/examples/heatmap/src/control-panel.js index cf5dda09..e618626a 100644 --- a/examples/heatmap/src/control-panel.js +++ b/examples/heatmap/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; export default class ControlPanel extends PureComponent { render() { diff --git a/examples/interaction/src/app.js b/examples/interaction/src/app.js index 3052e907..18466870 100644 --- a/examples/interaction/src/app.js +++ b/examples/interaction/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {Marker} from 'react-map-gl'; import ControlPanel from './control-panel'; diff --git a/examples/interaction/src/control-panel.js b/examples/interaction/src/control-panel.js index f36712a2..edf5a83b 100644 --- a/examples/interaction/src/control-panel.js +++ b/examples/interaction/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; const camelPattern = /(^|[A-Z])[a-z]*/g; diff --git a/examples/layers/src/app.js b/examples/layers/src/app.js index de5881df..ca04be95 100644 --- a/examples/layers/src/app.js +++ b/examples/layers/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL from 'react-map-gl'; import ControlPanel from './control-panel'; diff --git a/examples/layers/src/control-panel.js b/examples/layers/src/control-panel.js index 563206a2..658a0b05 100644 --- a/examples/layers/src/control-panel.js +++ b/examples/layers/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; import {fromJS} from 'immutable'; import MAP_STYLE from '../../map-style-basic-v8.json'; diff --git a/examples/locate-user/src/app.js b/examples/locate-user/src/app.js index 5646efca..ef27b17d 100644 --- a/examples/locate-user/src/app.js +++ b/examples/locate-user/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {GeolocateControl} from 'react-map-gl'; diff --git a/examples/reuse-map/src/app.js b/examples/reuse-map/src/app.js index 56d834f9..1bacbc78 100644 --- a/examples/reuse-map/src/app.js +++ b/examples/reuse-map/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import BartMap from './bart-map'; diff --git a/examples/reuse-map/src/bart-map.js b/examples/reuse-map/src/bart-map.js index e49656e2..802e0598 100644 --- a/examples/reuse-map/src/bart-map.js +++ b/examples/reuse-map/src/bart-map.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import MapGL, {Marker} from '../../../src'; import bartStations from '../../.data/bart-station.json'; diff --git a/examples/viewport-animation/src/app.js b/examples/viewport-animation/src/app.js index 522efbe4..14ca0d7b 100644 --- a/examples/viewport-animation/src/app.js +++ b/examples/viewport-animation/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {FlyToInterpolator} from 'react-map-gl'; diff --git a/examples/viewport-animation/src/control-panel.js b/examples/viewport-animation/src/control-panel.js index 12d049b4..63a755d4 100644 --- a/examples/viewport-animation/src/control-panel.js +++ b/examples/viewport-animation/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; import CITIES from '../../.data/cities.json'; diff --git a/examples/zoom-to-bounds/src/app.js b/examples/zoom-to-bounds/src/app.js index 4e172515..b12ac8b1 100644 --- a/examples/zoom-to-bounds/src/app.js +++ b/examples/zoom-to-bounds/src/app.js @@ -1,4 +1,5 @@ -import React, {Component} from 'react'; +import * as React from 'react'; +import {Component} from 'react'; import {render} from 'react-dom'; import MapGL, {LinearInterpolator, WebMercatorViewport} from 'react-map-gl'; import bbox from '@turf/bbox'; diff --git a/examples/zoom-to-bounds/src/control-panel.js b/examples/zoom-to-bounds/src/control-panel.js index 06f79a3d..7e868075 100644 --- a/examples/zoom-to-bounds/src/control-panel.js +++ b/examples/zoom-to-bounds/src/control-panel.js @@ -1,4 +1,5 @@ -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; export default class ControlPanel extends PureComponent { render() { diff --git a/src/components/base-control.js b/src/components/base-control.js index 94034e36..e0a945ff 100644 --- a/src/components/base-control.js +++ b/src/components/base-control.js @@ -18,7 +18,8 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React, {PureComponent, createRef} from 'react'; +import * as React from 'react'; +import {PureComponent, createRef} from 'react'; import PropTypes from 'prop-types'; import MapContext from './map-context'; diff --git a/src/components/fullscreen-control.js b/src/components/fullscreen-control.js index 3d552f38..7d7e80c1 100644 --- a/src/components/fullscreen-control.js +++ b/src/components/fullscreen-control.js @@ -23,7 +23,7 @@ import {document} from '../utils/globals'; import PropTypes from 'prop-types'; import BaseControl from './base-control'; -import React from 'react'; +import * as React from 'react'; import mapboxgl from '../utils/mapboxgl'; import type {BaseControlProps} from './base-control'; diff --git a/src/components/geolocate-control.js b/src/components/geolocate-control.js index 88966957..a4a46f84 100644 --- a/src/components/geolocate-control.js +++ b/src/components/geolocate-control.js @@ -1,7 +1,8 @@ // @flow /* global window */ -import React, {createRef} from 'react'; +import * as React from 'react'; +import {createRef} from 'react'; import PropTypes from 'prop-types'; import WebMercatorViewport from 'viewport-mercator-project'; diff --git a/src/components/interactive-map.js b/src/components/interactive-map.js index d13aa8b3..4e449d31 100644 --- a/src/components/interactive-map.js +++ b/src/components/interactive-map.js @@ -1,5 +1,6 @@ // @flow -import React, {PureComponent, createRef} from 'react'; +import * as React from 'react'; +import {PureComponent, createRef} from 'react'; import PropTypes from 'prop-types'; import StaticMap from './static-map'; diff --git a/src/components/layer.js b/src/components/layer.js index b4e0e2c6..fd882a26 100644 --- a/src/components/layer.js +++ b/src/components/layer.js @@ -18,7 +18,8 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React, {PureComponent} from 'react'; +import * as React from 'react'; +import {PureComponent} from 'react'; import PropTypes from 'prop-types'; import MapContext from './map-context'; import assert from '../utils/assert'; diff --git a/src/components/marker.js b/src/components/marker.js index bcac86cb..91c7482b 100644 --- a/src/components/marker.js +++ b/src/components/marker.js @@ -18,7 +18,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import DraggableControl from './draggable-control'; diff --git a/src/components/navigation-control.js b/src/components/navigation-control.js index 893a71e8..53c53bd4 100644 --- a/src/components/navigation-control.js +++ b/src/components/navigation-control.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import BaseControl from './base-control'; diff --git a/src/components/popup.js b/src/components/popup.js index bd38b9e8..004fa1bf 100644 --- a/src/components/popup.js +++ b/src/components/popup.js @@ -18,7 +18,8 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React, {createRef} from 'react'; +import * as React from 'react'; +import {createRef} from 'react'; import PropTypes from 'prop-types'; import BaseControl from './base-control'; diff --git a/src/components/scale-control.js b/src/components/scale-control.js index be4c3ed5..01e088df 100644 --- a/src/components/scale-control.js +++ b/src/components/scale-control.js @@ -18,7 +18,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import BaseControl from './base-control'; import mapboxgl from '../utils/mapboxgl'; diff --git a/src/components/source.js b/src/components/source.js index 000fb3e7..4dc735e3 100644 --- a/src/components/source.js +++ b/src/components/source.js @@ -18,7 +18,8 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React, {PureComponent, cloneElement} from 'react'; +import * as React from 'react'; +import {PureComponent, cloneElement} from 'react'; import PropTypes from 'prop-types'; import MapContext from './map-context'; import assert from '../utils/assert'; diff --git a/src/components/static-map.js b/src/components/static-map.js index 7454be69..99b178e9 100644 --- a/src/components/static-map.js +++ b/src/components/static-map.js @@ -18,7 +18,8 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React, {PureComponent, createRef} from 'react'; +import * as React from 'react'; +import {PureComponent, createRef} from 'react'; import PropTypes from 'prop-types'; import {normalizeStyle} from '../utils/style-utils'; diff --git a/src/overlays/canvas-overlay.js b/src/overlays/canvas-overlay.js index bcae19d6..e6e306a5 100644 --- a/src/overlays/canvas-overlay.js +++ b/src/overlays/canvas-overlay.js @@ -19,7 +19,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import BaseControl from '../components/base-control'; import {window} from '../utils/globals'; diff --git a/src/overlays/html-overlay.js b/src/overlays/html-overlay.js index 99c3ae72..e4a8058b 100644 --- a/src/overlays/html-overlay.js +++ b/src/overlays/html-overlay.js @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import BaseControl from '../components/base-control'; diff --git a/src/overlays/svg-overlay.js b/src/overlays/svg-overlay.js index 39324a1f..592b770d 100644 --- a/src/overlays/svg-overlay.js +++ b/src/overlays/svg-overlay.js @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import BaseControl from '../components/base-control'; diff --git a/test/render/index.js b/test/render/index.js index 49d21167..66d30d75 100644 --- a/test/render/index.js +++ b/test/render/index.js @@ -1,6 +1,6 @@ /* global window, document */ import test from 'tape-promise/tape'; -import React from 'react'; +import * as React from 'react'; import MapGL from 'react-map-gl'; import {render, unmountComponentAtNode} from 'react-dom'; diff --git a/test/render/test-cases.js b/test/render/test-cases.js index 5e27a814..b3a5c8f3 100644 --- a/test/render/test-cases.js +++ b/test/render/test-cases.js @@ -1,5 +1,5 @@ /* global __MAPBOX_TOKEN__ */ -import React from 'react'; +import * as React from 'react'; import {StaticMap, NavigationControl, GeolocateControl, Popup, Source, Layer} from 'react-map-gl'; const EMPTY_MAP_STYLE = { diff --git a/test/src/components/map.spec.js b/test/src/components/map.spec.js index e72a30bd..a6ff7c28 100644 --- a/test/src/components/map.spec.js +++ b/test/src/components/map.spec.js @@ -1,6 +1,6 @@ /* global setTimeout, clearTimeout */ import MapGL, {InteractiveMap} from 'react-map-gl'; -import React from 'react'; +import * as React from 'react'; import ReactTestUtils from 'react-test-renderer/shallow'; import ReactTestRenderer from 'react-test-renderer'; import sinon from 'sinon'; diff --git a/test/src/components/marker.spec.js b/test/src/components/marker.spec.js index 9d1c35e9..706d67fb 100644 --- a/test/src/components/marker.spec.js +++ b/test/src/components/marker.spec.js @@ -1,5 +1,5 @@ import {Marker} from 'react-map-gl'; -import React from 'react'; +import * as React from 'react'; import ReactTestRenderer from 'react-test-renderer'; import WebMercatorViewport from 'viewport-mercator-project'; import sinon from 'sinon'; diff --git a/website/src/home.js b/website/src/home.js index c2101d55..ab94fa7c 100644 --- a/website/src/home.js +++ b/website/src/home.js @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import {Home} from 'gatsby-theme-ocular/components'; import styled from 'styled-components';