-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fragments a la React https://react.dev/reference/react/Fragment #49
Comments
Hi! Yes, I wanted fragments a while ago, but it wasn't possible in snabbdom then IIRC. I was thinking that maybe the syntax could just be a list? But then I though, hey, lists are already supported... So maybe what you want is already possible? The only limitation at the moment is that component functions can't return a list. Was that your use case? |
Yep, that is my use case :^) |
Does it have to be a component? If you can make do with a regular function, it should work fine. |
I can use regular functions. I just wanted to use components for performance :^). |
|
For the record: Fragments are now available in snabbdom as (very) experimental: https://github.com/snabbdom/snabbdom?tab=readme-ov-file#fragment-experimental |
Hei hallo
Loving this library!
One thing I'm missing is fragments like React's
<>
syntax.Snabbdom has an experimental API for this: https://github.com/snabbdom/snabbdom?tab=readme-ov-file#fragment-experimental.
This would be extremely handy for use-cases where it is absolutely required that child elements are direct children of some parent; specifically CSS grid requires grid children to be direct children of the grid parent, no way around it. I have a very dynamic CSS grid and I would love to have one component for the grid header and one component for the grid rows.
I think the syntax should be
[:<> ...]
because it's similar to React and it's also the same syntax Rum and other hiccup libs use.God jul! 🎅
The text was updated successfully, but these errors were encountered: