Skip to content

Slots syntax in slots-unification is wrong #366

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

Closed
cathrinevaage opened this issue Aug 1, 2020 · 2 comments · Fixed by #365
Closed

Slots syntax in slots-unification is wrong #366

cathrinevaage opened this issue Aug 1, 2020 · 2 comments · Fixed by #365

Comments

@cathrinevaage
Copy link
Contributor

In guide/migration/slots-unification, the syntax for passing slots to a component is incorrect.
RawSlots is not part of props, the second parameter in the used h overload, but part of third parameter children.
The syntax is correctly documented elsewhere: guide/render-function.

Suggested edit:

## 3.x Syntax

- In 3.x, render functions will have a `slots` option where they can be defined instead.
+ In 3.x, render functions can take an object of `slots` as the `children` parameter instead.

```js
// 3.x Syntax
- h(LayoutComponent, {
-   slots: {
-     header: () => h('div', this.header),
-     content: () => h('div', this.content)
-   }
+ h(LayoutComponent, {}, {
+   header: () => h('div', this.header),
+   content: () => h('div', this.content)
+ })
```
@Aferz
Copy link
Contributor

Aferz commented Aug 1, 2020

PR: #365

We overlapped. Maintainers, feel free to close the PR if needed.

@NataliaTepluhina NataliaTepluhina linked a pull request Aug 1, 2020 that will close this issue
@NataliaTepluhina
Copy link
Member

@cathrinevaage and @Aferz thank you both for the report and suggested change! 🙇🏻‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants