Skip to content

Commit acc80b3

Browse files
committed
modify default value of svgProps property of MaterialIcon.astro
1 parent 33505b7 commit acc80b3

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/components/embed/MaterialIcon.astro

+5-10
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,11 @@ type Props = {
1212
svgProps?: ReactSVGAttributes;
1313
};
1414
15-
const {
16-
class: className,
17-
icon,
18-
style = "filled",
19-
svgProps = {
20-
height: undefined,
21-
width: undefined,
22-
fill: "currentColor",
23-
},
24-
} = Astro.props;
15+
const { class: className, icon, style = "filled", svgProps = {} } = Astro.props;
16+
17+
svgProps.width ??= undefined;
18+
svgProps.height ??= undefined;
19+
svgProps.fill ??= "currentColor";
2520
---
2621

2722
<span class:list={[className, "material-icon"]}

0 commit comments

Comments
 (0)