# @deck.gl/react ![From v10.0](https://img.shields.io/badge/from-v10.0-green.svg?style=flat-square) `@deck.gl/react` is a client-side React 19 renderer for deck.gl. It lets an application describe deck.gl layers and views in a React tree while keeping deck.gl's normal descriptor objects and ID-based diffing model. The package has four entry points: | Use case | Import | What it provides | | --- | --- | --- | | Applications | `@deck.gl/react` | The `DeckGL` root. | | Built-in deck.gl classes | `/core`, `/layers`, `/geo-layers`, `/aggregation-layers`, `/mesh-layers`, `/widgets` | A component for each view, layer, widget and effect shipped natively in deck.gl. | | Custom classes | `@deck.gl/react` | The factories for custom classes, and the ``, ``, `` and `` elements. Used by apps and libraries that write their own classes. | | Direct reconciler integration | `@deck.gl/react/reconciler` | Advanced root-management APIs. Most applications should use the native root instead. | ## How it works Import the root, then import a component for each deck.gl class from the subpath named after its deck.gl module. The JSX looks like deck.gl's own constructors: ```tsx import {DeckGL} from '@deck.gl/react'; import {MapView} from '@deck.gl/react/core'; import {ScatterplotLayer} from '@deck.gl/react/layers'; type Point = {coordinates: [number, number]}; export function Map({data}: {data: Point[]}) { return ( d.coordinates} getRadius={100} /> ); } ``` Each component builds a new instance from its props on every render, and deck.gl matches it with the previous one by `id`. Components can sit at any depth inside your own components, which can use hooks and context. [Using deck.gl with React](../../get-started/using-with-react.md) walks through each kind of component, [Components](components.md) lists them, and [Native elements](native-elements.md) covers instances you build yourself. ## Install and set up [Using deck.gl with React](../../get-started/using-with-react.md) covers installation, rendering on the client and sizing the root. The package requires `@deck.gl/core`, and `@deck.gl/widgets` for `@deck.gl/react/legacy`. Every other deck.gl package is an optional peer. Install `@deck.gl/mapbox`, `@deck.gl/maplibre` or `@deck.gl/google-maps` for its root, and the layer or widget package behind each component subpath you import. The plain root imports none of them. ## Guides and API reference - [Using deck.gl with React](../../get-started/using-with-react.md) walks through the root, client rendering, each kind of component, and instance access. - [Using with maps](../../developer-guide/react/using-with-maps.md) explains map roots and links the [Mapbox](../../developer-guide/react/base-maps/using-with-mapbox.md) and [MapLibre](../../developer-guide/react/base-maps/using-with-maplibre.md) and [Google Maps](../../developer-guide/react/base-maps/using-with-google-maps.md) guides. - [Migrating from the previous API](../../developer-guide/react/migrate-from-deckgl-react.md) lists the changes to make when coming from `@deck.gl/react/legacy`. - [Debugging](../../developer-guide/react/debugging.md) explains how to trace a problem through the renderer, with logs, React DevTools and error boundaries. - [DeckGL API](deckgl.md) documents root ownership and lifecycle behavior. - [Components](components.md) lists the component subpaths and the factories for custom classes. - [Native elements](native-elements.md) documents ``, ``, `` and ``. - The [React get-started examples](https://github.com/visgl/deck.gl/tree/master/examples-v10/get-started/react) are minimal applications, one per base map.