Skip to content

Commit

Permalink
Update layer.md (#2282)
Browse files Browse the repository at this point in the history
  • Loading branch information
augini authored and Pessimistress committed Dec 18, 2023
1 parent cbcb216 commit 0f21481
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/api-reference/layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,25 @@ When props change *shallowly*, the component will perform style diffing to updat

Once a `<Layer>` is mounted, the following props should not change. If you add/remove multiple JSX layers dynamically, make sure you use React's [key prop](https://reactjs.org/docs/lists-and-keys.html#keys) to give each element a stable identity.

#### `id`: string {#id}
#### `id`: string {#id}

Unique identifier of the layer. If not provided, a default id will be assigned.

#### `type`: string {#type}
#### `type`: string {#type}

Required. Type of the layer.

### Options

#### `beforeId`: string {#beforeid}
#### `beforeId`: string {#beforeid}

The ID of an existing layer to insert this layer before. If this prop is omitted, the layer will be appended to the end of the layers array. This is useful when using dynamic layers with a map style from a URL.

Note that layers are added by the order that they mount. They are *NOT* reordered later if their relative positions in the JSX tree change. If dynamic reordering is desired, you should manipulate `beforeId` for consistent behavior.

#### `source`: string {#source}
#### `source`: string {#source}

`source` is required by some layer types in the Mapbox style specification. If `<Layer>` is used as the child of a [Source](./source.md) component, this prop will be overwritten by the id of the parent source.
`source` is required by some layer types in the Mapbox style specification. If `<Layer>` is used as the immediate child of a [Source](./source.md) component, this prop will be overwritten by the id of the parent source. If the `<Layer/>` component is not an immediate descendant of `<Source/>`, e.g wrapped inside a helper component, source property needs to be provided same as the id of the `<Source/>` component for the `<Layer/>` component to show.


## Source
Expand Down

0 comments on commit 0f21481

Please sign in to comment.