mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
Clarify ref migration in upgrade guide (#1356)
This commit is contained in:
parent
59d7f7379a
commit
c5501f56b3
@ -16,6 +16,10 @@ const CONTROLLER_OPTS = {
|
||||
<MapGL {...CONTROLLER_OPTS} ... />
|
||||
```
|
||||
|
||||
- `Source` and `Layer` components no longer expose imperative methods via `ref` as part of the migration to functional components. This is to comply with the pattern recommended by the latest React.
|
||||
+ If you used to call `sourceRef.getSource()`, it can be replaced with `mapRef().getMap().getSource(sourceId)`.
|
||||
+ If you used to call `layerRef.getLayer()`, it can be replaced with `mapRef().getMap().getLayer(layerId)`.
|
||||
|
||||
## Upgrading to v6
|
||||
|
||||
- A valid Mapbox access token is always required.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user