finds.dev← search

// the find

mapbox/mapbox-react-examples

★ 622 · JavaScript · BSD-2-Clause · updated Sep 2023

Example patterns for building React apps with Mapbox GL JS

Official Mapbox collection of standalone React + Mapbox GL JS example apps covering common patterns: basic map setup, GeoJSON data overlays, custom markers, hover tooltips, and Redux integration. Each example is a self-contained CRA project you can clone and run. Aimed at developers starting out with Mapbox in React who want a working reference rather than documentation prose.

Each example is isolated with its own package.json, so you can lift one pattern without untangling a shared setup. The Redux variant is a useful contrast to the plain hook version — shows how state flows through a map component in both models. Hover tooltip and data-overlay examples cover the most common real-world ask (click/hover interaction with GeoJSON layers) in concrete, runnable code.

Dead since September 2023 and still on Create React App, which is itself abandoned — you will immediately hit peer dependency warnings and polyfill issues before writing a single line. No hooks-first patterns at all; everything is class components or function components with refs passed down as props, which is not how you would structure this today. The license is Mapbox TOS, not MIT — you cannot use these examples freely outside a paid Mapbox account, which is buried in the LICENSE file and easy to miss. No TypeScript examples, and with only 8 patterns total, anything beyond basic markers (clustering, 3D terrain, draw tools) is not covered.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →