Astro Still Lacks TypeScript Support for Named Slots, RFC Open Since 2022
Astro currently allows developers to type component props using TypeScript interfaces, but named slots cannot be typed in the same way, leaving a known gap in the framework. A GitHub RFC proposing typed slots has been open since December 2022, and an Astro core maintainer acknowledged the feature is planned but not yet on the roadmap. The complexity stems from the fact that slots inject markup rather than passing simple data values, and neither TSX tooling nor Astro's internal slot implementation fully supports the required typing mechanisms. As of 2024, a follow-up from the RFC author confirmed the issue remains unresolved. In the meantime, developers can work around the limitation by documenting slot names in comments or using runtime checks via the Astro.slots.has() API.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in