Skip to content

Commit dbb74ae

Browse files
committed
fix(site): keep component names
vitejs/vite#13727
1 parent 3ca8f2d commit dbb74ae

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changeset/sharp-suits-behave.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@suid/site": patch
3+
---
4+
5+
Keep component names

packages/site/src/components/ComponentInfo.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ import {
1111
Match,
1212
Show,
1313
Switch,
14+
mergeProps,
1415
} from "solid-js";
1516
import ComponentCode from "~/components/ComponentCode";
1617
import PageNav from "~/components/PageNav";
1718
import PaperCode from "~/components/PaperCode";
1819

19-
export default function ComponentInfo(props: {
20+
export default function ComponentInfo(inProps: {
2021
name: string;
2122
scope?: string;
2223
body?: JSXElement;
@@ -34,6 +35,11 @@ export default function ComponentInfo(props: {
3435
prevPage?: { text: string; href: string };
3536
nextPage?: { text: string; href: string };
3637
}) {
38+
const props = mergeProps(inProps, {
39+
get name() {
40+
return inProps.name.replace(/\d+$/, "");
41+
},
42+
});
3743
const name = createMemo(() => snakeCase(uncapitalize(props.name)));
3844
const theme = useTheme();
3945
const docsName = () => props.docsName ?? name();

0 commit comments

Comments
 (0)