From 076710672c1092f93a3e57971cc34d0d1c9404aa Mon Sep 17 00:00:00 2001 From: jeffvli Date: Wed, 8 Oct 2025 21:38:16 -0700 Subject: [PATCH] forward switch ref --- src/shared/components/switch/switch.tsx | 34 ++++++++++++++----------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/shared/components/switch/switch.tsx b/src/shared/components/switch/switch.tsx index e186f9292..aeb4f9494 100644 --- a/src/shared/components/switch/switch.tsx +++ b/src/shared/components/switch/switch.tsx @@ -1,23 +1,27 @@ import type { SwitchProps as MantineSwitchProps } from '@mantine/core'; import { Switch as MantineSwitch } from '@mantine/core'; +import { forwardRef, Ref } from 'react'; import styles from './switch.module.css'; type SwitchProps = MantineSwitchProps; -export const Switch = ({ classNames, ...props }: SwitchProps) => { - return ( - - ); -}; +export const Switch = forwardRef( + ({ classNames, ...props }: SwitchProps, ref: Ref) => { + return ( + + ); + }, +);