tyxml
tyxml copied to clipboard
Don't fix the type of children in jsx
The idea is that children
is just a prop. In the jsx
-ppx the children type is fixed, which is fine for normal elements, but it allows less flexibility for custom components.
Hmm, unfortunately we can't really do that one. The content of the nodes are a pseudo-list. For most implementation, that's the normal lists. However for things like reactive nodes it's not: we use the specific list constructions, specialized to the Tyxml elements in question.
We would have to change the type of the underlying list operations, and that break compat :/
But isn't it possible not to have a forced type annotation on the children argument of the createElement function when using JSX to construct those function calls? (If I call a createElement function without JSX it works great but somehow JSX is forcing a certain type on ~children
.).