diff --git a/docs/api-reference/layer.md b/docs/api-reference/layer.md index f4c4a8814..70dccf1bd 100644 --- a/docs/api-reference/layer.md +++ b/docs/api-reference/layer.md @@ -86,25 +86,25 @@ When props change *shallowly*, the component will perform style diffing to updat Once a `` 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 `` 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 `` 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 `` component is not an immediate descendant of ``, e.g wrapped inside a helper component, source property needs to be provided same as the id of the `` component for the `` component to show. ## Source