Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update layer.md #2282

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading