Skip to content

Commit db58664

Browse files
authored
refactor: use proper type for switch forward ref (#2277)
1 parent fcfd554 commit db58664

File tree

1 file changed

+1
-2
lines changed
  • packages/@headlessui-react/src/components/switch

1 file changed

+1
-2
lines changed

packages/@headlessui-react/src/components/switch/switch.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ let SwitchRoot = forwardRefWithAs(function Switch<
111111
name?: string
112112
value?: string
113113
},
114-
ref: Ref<HTMLElement>
114+
ref: Ref<HTMLButtonElement>
115115
) {
116116
let internalId = useId()
117117
let {
@@ -128,7 +128,6 @@ let SwitchRoot = forwardRefWithAs(function Switch<
128128
let switchRef = useSyncRefs(
129129
internalSwitchRef,
130130
ref,
131-
// @ts-expect-error figure out the correct type here
132131
groupContext === null ? null : groupContext.setSwitch
133132
)
134133

0 commit comments

Comments
 (0)