Skip to content

Add a section about functional components #1008

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

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

skirtles-code
Copy link
Contributor

This adds a short section about functional components to the render functions page. The positioning is the same as in the Vue 2 docs.

I originally wrote a lot more material, including a proper example, but in the end I decided to cut it down to a minimal description of the key technical details and leave it at that.

@@ -136,9 +136,9 @@ The `h()` function is a utility to create VNodes. It could perhaps more accurate
```js
// @returns {VNode}
h(
// {String | Object | Function } tag
// An HTML tag name, a component or an async component.
// Using function returning null would render a comment.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A function returning null is not really a special case, it's just a functional component. #1006 mentions that returning null creates a comment.

@@ -300,7 +300,7 @@ Vue.component('my-special-transition', {
})
```

And [functional components](render-function.html#Functional-Components) are especially well-suited to this task:
And [functional components](render-function.html#functional-components) are especially well-suited to this task:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section needs major work to update it for Vue 3 but at least this link goes somewhere now.

@skirtles-code skirtles-code marked this pull request as ready for review April 23, 2021 06:14
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 this pull request may close these issues.

2 participants