Replies: 3 comments
-
I would be great to have some official primitive in solid/dom-expressions for that use. Kobalte-ui is solving that through a polymorphic There is also an interesting experiment in solid-radix for applying attributes to already resolved elements. (like |
Beta Was this translation helpful? Give feedback.
-
Yeah it's is tricky because at the time you get them they've already been created. On the client yeah you can modify the DOM. On the server that would basically be string manipulation. Truthfully child introspection is a really awkward pattern for declarative libraries and gets in the way of optimization. Even the React Core team (in React this pattern is more common) considers this a bad pattern and effectively deprecated in their minds. I get the scenarios and the APIs it opens up but I think it requires careful consideration. Stuff like passing in the factory function is a better pattern in general. I think I'm going to move this into discussions so we can collect ideas here. |
Beta Was this translation helpful? Give feedback.
-
A primitive for this would be useful for the transition-group as well. Because if user enables |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As far as I can tell, there is no easy way of adding attributes to children passed into the parent.
Adding them to a client side render is easy enough, but for SSR beyond parsing the output HTML, I'm not sure how you'd do it.
Currently accessing the children prop results in:
Instead or rather additionally as not to break compatibility the implementation should look something like the following:
So it can be used like so:
Cheers!
Edit: Just realised this is probably best suited for the dom-expressions repo, forgot the transpiler is separate - sorry! Happy to move if needed.
Beta Was this translation helpful? Give feedback.
All reactions