mirror of
https://github.com/visgl/react-map-gl.git
synced 2025-12-08 20:16:02 +00:00
22 lines
529 B
JavaScript
22 lines
529 B
JavaScript
/* global document */
|
|
import * as React from 'react';
|
|
import {createRoot} from 'react-dom/client';
|
|
import {MapProvider} from 'react-map-gl/mapbox';
|
|
|
|
import Map from './map';
|
|
import Controls from './controls';
|
|
|
|
function Root() {
|
|
// Note: `useMap` will not work here, only child components of `MapProvider` or `Map` can use `useMap`
|
|
|
|
return (
|
|
<MapProvider>
|
|
<Controls />
|
|
<Map />
|
|
</MapProvider>
|
|
);
|
|
}
|
|
|
|
const root = createRoot(document.body.appendChild(document.createElement('div')));
|
|
root.render(<Root />);
|