Skip to content

Commit 827a9ca

Browse files
committed
Fix docs errors and warnings
1 parent d066dbc commit 827a9ca

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

docs/sliver-docs/components/markdown.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
ComponentPropsWithoutRef,
88
ReactNode,
99
createElement,
10+
isValidElement,
1011
useCallback,
1112
useEffect,
1213
useMemo,
@@ -52,8 +53,9 @@ const extractText = (node: ReactNode): string => {
5253
if (Array.isArray(node)) {
5354
return node.map(extractText).join("");
5455
}
55-
if (typeof node === "object" && "props" in (node as Record<string, unknown>)) {
56-
return extractText((node as any).props?.children);
56+
if (isValidElement(node)) {
57+
const { children } = node.props as { children?: ReactNode };
58+
return extractText(children);
5759
}
5860
return "";
5961
};
@@ -112,7 +114,7 @@ const MarkdownViewer = (props: MarkdownProps) => {
112114
}
113115

114116
const anchor = anchorRef.current;
115-
const HeadingTag = `h${level}` as keyof JSX.IntrinsicElements;
117+
const HeadingTag = `h${level}`;
116118

117119
return createElement(
118120
HeadingTag,
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import {heroui} from "@heroui/theme"
1+
const { heroui } = require("@heroui/theme");
22

33
/** @type {import('tailwindcss').Config} */
4-
const config = {
4+
module.exports = {
55
content: [
6-
'./components/**/*.{js,ts,jsx,tsx,mdx}',
7-
'./app/**/*.{js,ts,jsx,tsx,mdx}',
8-
"./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}"
6+
"./components/**/*.{js,ts,jsx,tsx,mdx}",
7+
"./app/**/*.{js,ts,jsx,tsx,mdx}",
8+
"./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}",
99
],
1010
theme: {
1111
extend: {
@@ -17,6 +17,4 @@ const config = {
1717
},
1818
darkMode: "class",
1919
plugins: [heroui()],
20-
}
21-
22-
module.exports = config;
20+
};

0 commit comments

Comments
 (0)