Replies: 1 comment
-
This is intended behavior. For state-derived child nodes, the binding function can't return an array of nodes due to the limitation of DOM. You are encouraged to wrap the array with a pass-through container (e.g.: You can refer to section |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a scenario where I'd like a reactive element's contents to contain a dynamic list of elements. While the example below is contrived (e.g. nothing here is reactive), it still shows the issue in a concise way:
The output here shows the last items in the div being coerce to strings:
I've solved this by bumping the function wrapper up to a higher level (e.g.:
() => van.tags.div({class: 'test'}, ...)
. I did find it surprising that returning lists causes string coercion, but normally lists within tags are expanded as if passed as individual arguments.Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions