Skip to content

Commit

Permalink
docs: added a note to component's children section (#1600)
Browse files Browse the repository at this point in the history
* docs: updated components docs, added a note on the children section

* add changeset

* updated snapshots

* Revert "updated snapshots"

This reverts commit 5c1b65c.

* Revert "add changeset"

This reverts commit 0ce66d3.

* Update packages/docs/src/routes/docs/components/index.mdx

---------

Co-authored-by: Sami Jaber <[email protected]>
  • Loading branch information
seasheepjoe and samijaber authored Oct 21, 2024
1 parent 12639bb commit b9af061
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/docs/src/routes/docs/components/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ export default function MyComponent(props) {

</details>

> **Note**: You cannot directly iterate over the children prop. It is a special property intended for rendering like this:
```jsx
<div>{props.children}</div>
````

Many frameworks do not support manipulating or iterating over it directly, unlike frameworks such as React or Vue.

### Slot

When you want to register a named slot you do so using a prop.
Expand Down

0 comments on commit b9af061

Please sign in to comment.