Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[2.1.5+]Multiple root nodes from functional component render function not allowed now? #4472
Labels
Comments
I met the same problem, I want to use version 2.1.4, what should I do? |
Use 2.1.5+ versions and encapsule all the elements in additional parent like so: return h('div', {}, [h('label', 'Test123'), h('label', 'Test123')]; Or just revert to 2.1.4 and wait to see what will happen with this Issue. |
The question has been decided.Thank you so much. |
I use functional component as the only way to get rid of extraneous root component |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vue.js version
2.1.5, 2.1.6
Reproduction Link
[2.1.4] https://jsfiddle.net/uriziel01/kx1yuu3a/ [working]
[2.1.5] https://jsfiddle.net/uriziel01/kx1yuu3a/3/ [broken]
Steps to reproduce
Return array of elements from render function in functional component.
What is Expected?
Multiple root nodes seems to be dissallowed in Vue2 everywhere but not here.
I think that the correct solution would be to throw appropriate error to console and avoid returning
undefined
. Or is that designed logic and this should be handled by the engine as it was in older versions? You decide.What is actually happening?
undefined
is rendered as a result and no correct error is thrown to the console.