S
SolidJS11mo ago
Nathan

Accessing grandchildren

I'm using Astro, and I have an Astro component that passes children to a Solid component. I'd like to iterate over these children, but, unfortunately, Astro wraps them all in a <astro-slot> element. Is there a way to access the children of this element through props.children?
5 Replies
Jasmin
Jasmin11mo ago
Hmm I think that's not possible. What do you want to accomplish? Maybe there is another way.
Nathan
Nathan11mo ago
I'm using the Solid JS Swiper component to render a slideshow. What I'd like to do is use Astro's <Image> component to handle optimization of the images, and then pass those components as children to be placed within individual slides in Swiper. However, the behavior I'm getting is that all children images are rendered into a single slide, rather defeating the purpose.
Jasmin
Jasmin11mo ago
Do keyed slots not work? *named slots
Nathan
Nathan11mo ago
That might work if I know how many slots are needed ahead of time.
Want results from more Discord servers?
Add your server