Currently, it's not allowed to nest functions when updating children. Following code would error:
create "Frame" {
indexes(t, function(name)
return show(s, function()
return create "Frame" {
Name = name
}
end)
end)
}
We can allow this behavior though through adding a single case to the update_children_effect function
elseif type(child) == "function" then
process_child(child())
which would make the first example valid.
There is some value in allowing this behavior, as we would now be able to infinitely nest indexes, show, etc which may be more intuitive in roblox-ts. I believe @littensy also wanted this, considering that many of the control flow functions in vide are tsx elements there. Being able to treat them as regular components would be really nice for UX.
Currently, it's not allowed to nest functions when updating children. Following code would error:
We can allow this behavior though through adding a single case to the
update_children_effect
functionwhich would make the first example valid.
There is some value in allowing this behavior, as we would now be able to infinitely nest indexes, show, etc which may be more intuitive in roblox-ts. I believe @littensy also wanted this, considering that many of the control flow functions in vide are tsx elements there. Being able to treat them as regular components would be really nice for UX.