fix: define component Props type instead of typecasting Astro.props
This surfaces some type errors in props being passed to some components, particularly in the way Features passes the classes props.
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
---
|
||||
import type { HTMLTag } from "astro/types";
|
||||
import type { Widget } from "~/types";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import Background from "./Background.astro";
|
||||
|
||||
export interface Props extends Widget {
|
||||
containerClass?: string;
|
||||
["as"]?: HTMLTag;
|
||||
}
|
||||
|
||||
const { id, isDark = false, containerClass = "", bg, as = "section" } = Astro.props;
|
||||
|
||||
const WrapperTag = as;
|
||||
|
Reference in New Issue
Block a user