Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fix the type of children in jsx #270

Open
jfrolich opened this issue Jun 22, 2020 · 2 comments
Open

Don't fix the type of children in jsx #270

jfrolich opened this issue Jun 22, 2020 · 2 comments

Comments

@jfrolich
Copy link

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.

@Drup
Copy link
Member

Drup commented Jun 22, 2020

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 :/

@jfrolich
Copy link
Author

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.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants