Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 664 Bytes

map-provider.md

File metadata and controls

26 lines (18 loc) · 664 Bytes

MapProvider

A Context.Provider that facilitates map operations outside of the component that directly renders a Map.

The component should wrap all nodes in which you may want to access the maps:

import {MapProvider} from 'react-map-gl/mapbox';

function Root() {
  return (
    <MapProvider>
      {
        // Application tree, somewhere one or more <Map /> component(s) are rendered
      }
    </MapProvider>
  );
}

See useMap for more information.

Source

use-map.tsx