I am creating a dynamic cart for an ecommerce store. Here is the props for my Solid.js component:
type CartProps = {
children: JSX.Element;
cartIcon: JSX.Element;
closeIcon: JSX.Element;
};
Here is a snippet of my Astro component using this framework component:
<Cart client:load>
<Icon name="cart" size={30} slot="cartIcon" />
<Icon name="close" size={30} slot="closeIcon" />
<div>
<p class="text-center text-lg font-bold">Cart</p>
<p class="text-center text-sm">Your cart is empty</p>
</div>
</Cart>
The problem in my Astro component, is that Cart is throwing an error:
Type '{ children: any[]; "client:load": true; }' is missing the following properties from type 'CartProps': cartIcon, closeIcon
Solid.js is retrieving all the necessary data through props successfully. Because the slots were not passed in as attributes, I am getting errors. Is there a way to fix this type error in Astro/Solid.js?