Skip to content

allow functional components to return multiple VNodes (fix #8191) #8192

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
Oct 24, 2018

Conversation

zevdg
Copy link
Contributor

@zevdg zevdg commented May 15, 2018

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@zevdg
Copy link
Contributor Author

zevdg commented May 15, 2018

fixes #8191

Copy link
Member

@ktsn ktsn left a comment

Choose a reason for hiding this comment

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

Thanks. Can we add a test case for this?

@zevdg
Copy link
Contributor Author

zevdg commented May 16, 2018

Silly me. I assumed that since vue was preliminary a Javascript project, it wouldn't have the typescript toolchain installed, and therefore wouldn't be able to test the types. I'll add a test for this to yarn test:types.

@zevdg zevdg force-pushed the typescript-multi-root-component branch from 051acda to 699f44d Compare May 16, 2018 22:05
@HerringtonDarkholme
Copy link
Member

@ktsn @LinusBorg Is this a public API ? I checked the doc here https://vuejs.org/v2/api/#render and here https://vuejs.org/v2/api/#render. But it seems nowhere mentions multiple root.

@zevdg
Copy link
Contributor Author

zevdg commented May 17, 2018

The most official source I've seen on the topic has been a core team member here suggesting it as an option at #7088 (comment)

Given that articles like https://zendev.com/2018/05/07/multi-root-vue-components.html are starting to pop up, it probably ought to be added to https://vuejs.org/v2/guide/render-function.html#Functional-Components. I'm surprised it wasn't already.

@LinusBorg
Copy link
Member

@HerringtonDarkholme It's definitely official API. It's one of the reasons functional components were created in the first place.

But looking at the current documentation, it's not mentioned (anymore?)

/cc @chrisvfritz

@chrisvfritz
Copy link
Contributor

Oh, I thought I did mention it. I'll add it. 👍

@zevdg
Copy link
Contributor Author

zevdg commented Jun 15, 2018

is there anything holding this up?

@zevdg
Copy link
Contributor Author

zevdg commented Jul 24, 2018

poking this again, is there anything else I need to do to get this merged?

@LinusBorg
Copy link
Member

Please be patient, we are currently wrapping up work on other core projects and will return attention back to the core repository shortly.

@zevdg
Copy link
Contributor Author

zevdg commented Jul 24, 2018

No worries. Thanks for the update :-)

@luxalpa
Copy link

luxalpa commented Oct 19, 2018

3 months later, what's holding this up?

Also this requires possible return value undefined (or null?) as far as I see, since functional components can also return nothing.

@yyx990803 yyx990803 merged commit bf2e2ed into vuejs:dev Oct 24, 2018
f2009 pushed a commit to f2009/vue that referenced this pull request Jan 25, 2019
aJean pushed a commit to aJean/vue that referenced this pull request Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants