#How to import an astro component's interface Props type?
3 messages · Page 1 of 1 (latest)
Hi @quiet grail. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To reference the props type of an Astro component (such as PostView), you should use the ComponentProps utility type from astro/types. This allows you to infer the props type of a component, even if the Props interface is not exported from the component itself.
Here’s how you can do it:
import type { ComponentProps } from "astro/types";
import PostView from "./PostView.astro";
type PostViewProps = ComponentProps<typeof PostView>;