refactor: 更新组件引用类型为 ComponentRef,以提高类型安全性

This commit is contained in:
2026-07-09 23:28:59 +08:00
parent 14d85e5265
commit f0c3d9c173
5 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import * as SwitchPrimitives from '@radix-ui/react-switch';
import { cn } from '@/lib/utils';
const Switch = React.forwardRef<
React.ElementRef<typeof SwitchPrimitives.Root>,
React.ComponentRef<typeof SwitchPrimitives.Root>,
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root