You should decalre data type for type when you declare skyLayer. Because the default type will be string and can' be pass into Layer. You can use as to do it:
const skyLayer = {
id: 'sky',
type: 'sky' as 'sky',
paint: {
'sky-type': 'atmosphere',
'sky-atmosphere-sun': [0.0, 0.0],
'sky-atmosphere-sun-intensity': 15
}
};
Answer from Viet on Stack Overflownpm
npmjs.com › package › @types › react-map-gl
types/react-map-gl
February 21, 2026 - This package contains type definitions for react-map-gl (https://github.com/visgl/react-map-gl#readme).
» npm install @types/react-map-gl
Published Feb 21, 2026
Version 6.1.8
npm
npmjs.com › package › react-map-gl
react-map-gl - npm
3 weeks ago - React components for MapLibre GL JS and Mapbox GL JS. Latest version: 8.1.1, last published: 19 days ago. Start using react-map-gl in your project by running `npm i react-map-gl`. There are 482 other projects in the npm registry using react-map-gl.
» npm install react-map-gl
Published Apr 11, 2026
Version 8.1.1
Videos
50:04
Building with Mapbox GL JS in React - YouTube
react mapbox gl integration to show marker on map | React ...
03:00
React map with a marker maplibre gl js | 2023 tutorial step by ...
19:11
react mapbox gl | Polygon layers tutorial - YouTube
Chakra UI - MAP integration in React with react-map-gl and ...
React Map GL
visgl.github.io › introduction
Introduction | react-map-gl
We sometimes render two maps side by side, and when the user interacts with one, update both cameras. We draw React UI outside of the map container, that moves with the camera. We also render WebGL graphic overlays on top of the map, most notably with deck.gl.
GitHub
github.com › visgl › react-map-gl
GitHub - visgl/react-map-gl: React friendly API wrapper around MapboxGL JS · GitHub
react-map-gl is a suite of React components designed to provide a React API for mapbox-gl or maplibre-gl.
Starred by 8.4K users
Forked by 1.4K users
Languages TypeScript 65.5% | JavaScript 32.2%
React Map GL
visgl.github.io › react-map-gl
Home | react-map-gl
Use a MapLibre GL JS or Mapbox GL JS map as a fully controlled reactive component.
React Map GL
visgl.github.io › types
Types | react-map-gl
A JSON object that defines a raster-dem source according to the Maplibre Style Specification. A JSON object that defines a canvas source type.
Top answer 1 of 2
5
You should decalre data type for type when you declare skyLayer. Because the default type will be string and can' be pass into Layer. You can use as to do it:
const skyLayer = {
id: 'sky',
type: 'sky' as 'sky',
paint: {
'sky-type': 'atmosphere',
'sky-atmosphere-sun': [0.0, 0.0],
'sky-atmosphere-sun-intensity': 15
}
};
2 of 2
0
You should import SkyLayer as a type from react-map-gl.
import type {SkyLayer} from 'react-map-gl';
const skyLayer:SkyLayer = {
id: 'sky',
type: 'sky',
paint: {
'sky-type': 'atmosphere',
'sky-atmosphere-sun': [0.0, 0.0],
'sky-atmosphere-sun-intensity': 15
}
};
Take a look at this example.
React Map GL
visgl.github.io › upgrade guide
Upgrade Guide | react-map-gl
maplibre-gl users no longer need to install mapbox-gl or a placeholder package as dependency. Change your imports to the new endpoint react-map-gl/maplibre. Components imported from here do not require setting the mapLib prop, and use the types defined by maplibre-gl.
React Map GL
visgl.github.io › what's new
What's new | react-map-gl
Almost all imperative APIs (flyTo, fitBounds etc.) can now be called directly without breaking the React binding. Compatibility: first and third-party plugins! Directly use mapbox-gl-draw, mapbox-gl-geocoder, to name a few. TypeScript compliant: the code base is now entirely written in TypeScript, and all types can be imported.
React Map GL
visgl.github.io › get started
Get Started | react-map-gl
Using react-map-gl requires node >= 12 and react >= 16.3.
GitHub
github.com › DefinitelyTyped › DefinitelyTyped › blob › master › types › react-map-gl › index.d.ts
DefinitelyTyped/types/react-map-gl/index.d.ts at master · DefinitelyTyped/DefinitelyTyped
zoom(input: PositionInput & { scale: number; startPos?: [number, number] | undefined }): MapState; ... export class BaseControl<T extends BaseControlProps, S extends Element> extends React.PureComponent<T> {
Author DefinitelyTyped
GitHub
github.com › urbica › react-map-gl
GitHub - urbica/react-map-gl: React Component Library for Mapbox GL JS · GitHub
Except for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled. import React from 'react'; import MapGL, { Source, Layer } from '@urbica/react-map-gl'; import 'mapbox-gl/dist/mapbox-gl.css'; <MapGL style={{ width: '100%', height: '400px' }} mapStyle='mapbox://styles/mapbox/light-v9' accessToken={MAPBOX_ACCESS_TOKEN} > <Source id='contours' type='vector' url='mapbox://mapbox.mapbox-terrain-v2' /> <Layer id='contours' type='line' source='contours' source-layer='contour' paint={{ 'line-color': '#877b59', 'line-width': 1 }} /> </MapGL>;
Starred by 424 users
Forked by 49 users
Languages JavaScript
GitHub
github.com › visgl › react-map-gl › releases
Releases · visgl/react-map-gl
First version to support Mapbox GL JS' official types and MapLibre GL JS v5. This version fully separates the code that support each compatible map library: react-map-gl/mapbox: for use with mapbox-gl>=3.5.0
Author visgl
CodeSandbox
codesandbox.io › examples › package › @types › react-map-gl
types/react-map-gl examples
Use this online @types/react-map-gl playground to view and fork @types/react-map-gl example apps and templates on CodeSandbox.
Nebula
nebula.gl › docs › api-reference › react-map-gl-draw › react-map-gl-draw
React Map GL Draw
{ id, // an unique identified generated inside react-map-gl-draw library geometry: { coordinates, // latitude longitude pairs of the geometry points type // geojson type, one of `Point`, `LineString`, or `Polygon` }, properties: { renderType, // Mainly used for styling, one of `Point`, `LineString`, `Polygon`, or `Rectangle`. Different from `geometry.type`. i.e.
React Map GL
visgl.github.io › adding custom data
Adding Custom Data | react-map-gl
import * as React from 'react'; import Map, {Source, Layer} from 'react-map-gl/maplibre'; import type {CircleLayer} from 'react-map-gl/maplibre'; import type {FeatureCollection} from 'geojson'; const geojson: FeatureCollection = { type: 'FeatureCollection', features: [ { type: 'Feature', geometry: { type: 'Point', coordinates: [-122.4, 37.8] }, properties: {title: '915 Front Street, San Francisco, California'} } ] }; const layerStyle: CircleLayer = { id: 'point', type: 'circle', paint: { 'circle-radius': 10, 'circle-color': '#007cbf' } }; function App() { return ( <Map initialViewState={{ longitude: -122.45, latitude: 37.78, zoom: 14 }}> <Source id="my-data" type="geojson" data={geojson}> <Layer {...layerStyle} /> </Source> </Map> ); }
React Map GL
visgl.github.io › default (map)
default (Map) | react-map-gl
React component that wraps mapbox-gl's Map class. This is also the default export from react-map-gl.