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

docs: added a note to component's children section #1600

Merged
merged 6 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions .changeset/stupid-pants-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/mitosis': patch
---

added note on children prop to inform about children prop iteration
samijaber marked this conversation as resolved.
Show resolved Hide resolved
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:

```javascript
samijaber marked this conversation as resolved.
Show resolved Hide resolved
<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