Closed ArthurSonzogni closed 5 years ago
Hi @ArthurSonzogni,
in the latest version of asm-dom a normalization of VNodes is executed immediately after their creation. So, in this case new children are simply ignored... It will continue to work after the merge and release of PR #21, since the normalization will take place only when really needed (when patch
is called).
However, adding children after the creation of a VNode is not recommended, it should be created using CPX or the h
function and then never modified by the user.
With CPX you can set children dynamically in the way defined here, using asmdom::Children
.
I think we can leave this issue open and update the doc to highlight it. What do you think? Let me know if it works fine after that little change 😄
Yes, I am now using it with:
asmdom::Children children
for(auto it = ..)
children.push_back(it)
return <div> {...children} </div>
Which looks better to me.
Feel free to close this bug. I just observed something regressed, but not supporting this looks good to me.
Perfect! I'll close this
I discovered my example: https://github.com/ArthurSonzogni/asm-dom-starter/blob/master/src/index.cpp
doesn't work anymore on version 0.6.2
Here is the relevant snippet:
I tried adding one child in the initial action_list element. Then my manually added children are properly displayed.
It looks like a regression. Or maybe I was using it the wrong way.