@@ -5,81 +5,77 @@ import { TypeTable } from "fumadocs-ui/components/type-table";
55
66import { Link } from "next-view-transitions" ;
77
8+ const properties = {
9+ additionalHooks : {
10+ type : "Record<ReactBuiltInHookName, string[]>" ,
11+ description : < Link href = "#additionalhooks" > An object of aliases for React built-in Hooks ⤵</ Link > ,
12+ default : "{}" ,
13+ typeDescription : (
14+ < CodeBlock
15+ code = { dedent `
16+ type ReactBuiltInHookName =
17+ | "use"
18+ | "useActionState"
19+ | "useCallback"
20+ | "useContext"
21+ | "useDebugValue"
22+ | "useDeferredValue"
23+ | "useEffect"
24+ | "useFormStatus"
25+ | "useId"
26+ | "useImperativeHandle"
27+ | "useInsertionEffect"
28+ | "useLayoutEffect"
29+ | "useMemo"
30+ | "useOptimistic"
31+ | "useReducer"
32+ | "useRef"
33+ | "useState"
34+ | "useSyncExternalStore"
35+ | "useTransition";
36+ ` }
37+ lang = "ts"
38+ />
39+ ) ,
40+ } ,
41+ additionalComponents : {
42+ type : "CustomComponent[]" ,
43+ description : < Link href = "#additionalcomponents" > An array of components and its attributes mapping ⤵</ Link > ,
44+ default : "[]" ,
45+ typeDescription : (
46+ < CodeBlock
47+ code = { dedent `
48+ type CustomComponent = {
49+ name: string;
50+ as?: string;
51+ attributes?: {
52+ name: string;
53+ as?: string;
54+ defaultValue?: string;
55+ }[]
56+ }
57+ ` }
58+ lang = "ts"
59+ />
60+ ) ,
61+ } ,
62+ polymorphicPropName : {
63+ type : "string" ,
64+ description : < Link href = "#polymorphicpropname" > The prop your code uses to create polymorphic components ⤵</ Link > ,
65+ default : '"as"' ,
66+ } ,
67+ importSource : {
68+ type : "string" ,
69+ description : < Link href = "#importsource" > The source where React is imported from ⤵</ Link > ,
70+ default : '"react"' ,
71+ } ,
72+ version : {
73+ type : "string" ,
74+ description : < Link href = "#version" > React version to perform the analysis ⤵</ Link > ,
75+ default : '"detect"' ,
76+ } ,
77+ } ;
78+
879export function AnalyzerPropertyTypeTable ( ) {
9- return (
10- < TypeTable
11- type = { {
12- version : {
13- type : "string" ,
14- description : < Link href = "#version" > React version to perform the analysis ⤵</ Link > ,
15- default : '"detect"' ,
16- } ,
17- importSource : {
18- type : "string" ,
19- description : < Link href = "#importsource" > The source where React is imported from ⤵</ Link > ,
20- default : '"react"' ,
21- } ,
22- polymorphicPropName : {
23- type : "string" ,
24- description : (
25- < Link href = "#polymorphicpropname" > The prop your code uses to create polymorphic components ⤵</ Link >
26- ) ,
27- default : '"as"' ,
28- } ,
29- additionalComponents : {
30- type : "CustomComponent[]" ,
31- description : < Link href = "#additionalcomponents" > An array of components and its attributes mapping ⤵</ Link > ,
32- default : "[]" ,
33- typeDescription : (
34- < CodeBlock
35- code = { dedent `
36- type CustomComponent = {
37- name: string;
38- as?: string;
39- attributes?: {
40- name: string;
41- as?: string;
42- defaultValue?: string;
43- }[]
44- }
45- ` }
46- lang = "ts"
47- />
48- ) ,
49- } ,
50- additionalHooks : {
51- type : "Record<ReactBuiltInHookName, string[]>" ,
52- description : < Link href = "#additionalhooks" > An object of aliases for React built-in Hooks ⤵</ Link > ,
53- default : "{}" ,
54- typeDescription : (
55- < CodeBlock
56- code = { dedent `
57- type ReactBuiltInHookName =
58- | "use"
59- | "useActionState"
60- | "useCallback"
61- | "useContext"
62- | "useDebugValue"
63- | "useDeferredValue"
64- | "useEffect"
65- | "useFormStatus"
66- | "useId"
67- | "useImperativeHandle"
68- | "useInsertionEffect"
69- | "useLayoutEffect"
70- | "useMemo"
71- | "useOptimistic"
72- | "useReducer"
73- | "useRef"
74- | "useState"
75- | "useSyncExternalStore"
76- | "useTransition";
77- ` }
78- lang = "ts"
79- />
80- ) ,
81- } ,
82- } }
83- />
84- ) ;
80+ return < TypeTable type = { properties } /> ;
8581}
0 commit comments