Skip to content

Commit 0f21481

Browse files
auginiPessimistress
authored andcommitted
Update layer.md (#2282)
1 parent cbcb216 commit 0f21481

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/api-reference/layer.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,25 @@ When props change *shallowly*, the component will perform style diffing to updat
8686

8787
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.
8888

89-
#### `id`: string {#id}
89+
#### `id`: string {#id}
9090

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

93-
#### `type`: string {#type}
93+
#### `type`: string {#type}
9494

9595
Required. Type of the layer.
9696

9797
### Options
9898

99-
#### `beforeId`: string {#beforeid}
99+
#### `beforeId`: string {#beforeid}
100100

101101
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.
102102

103103
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.
104104

105-
#### `source`: string {#source}
105+
#### `source`: string {#source}
106106

107-
`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.
107+
`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.
108108

109109

110110
## Source

0 commit comments

Comments
 (0)