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,6 +1,6 @@
|
||||
---
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import type { Brands } from '~/types';
|
||||
import type { Brands as Props } from '~/types';
|
||||
import Headline from '~/components/ui/Headline.astro';
|
||||
import WidgetWrapper from '~/components/ui/WidgetWrapper.astro';
|
||||
const {
|
||||
@@ -13,7 +13,7 @@ const {
|
||||
isDark = false,
|
||||
classes = {},
|
||||
bg = await Astro.slots.render('bg'),
|
||||
} = Astro.props as Brands;
|
||||
} = Astro.props;
|
||||
---
|
||||
|
||||
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-6xl mx-auto ${classes?.container ?? ''}`} bg={bg}>
|
||||
|
||||
Reference in New Issue
Block a user