// @flow import * as React from 'react'; import {useState} from 'react'; import {render} from 'react-dom'; import MapGL, {NavigationControl} from 'react-map-gl'; import type {ViewportProps} from 'react-map-gl'; const MAPBOX_TOKEN = ''; // Set your mapbox token here function Root() { const [viewport, setViewport] = useState({ // width: '100vw', // should generate flow error latitude: 37.8, longitude: -122.4, zoom: 14, bearing: 0, pitch: 0 }); return ( setViewport(nextViewport)} mapboxApiAccessToken={MAPBOX_TOKEN} > ); } /* global document */ if (document.body) { document.body.style.margin = '0'; render(, document.body.appendChild(document.createElement('div'))); }