Skip to content

Commit

Permalink
refactor: use proper type for switch forward ref (#2277)
Browse files Browse the repository at this point in the history
  • Loading branch information
thetnaingtn authored Feb 13, 2023
1 parent fcfd554 commit db58664
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/@headlessui-react/src/components/switch/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ let SwitchRoot = forwardRefWithAs(function Switch<
name?: string
value?: string
},
ref: Ref<HTMLElement>
ref: Ref<HTMLButtonElement>
) {
let internalId = useId()
let {
Expand All @@ -128,7 +128,6 @@ let SwitchRoot = forwardRefWithAs(function Switch<
let switchRef = useSyncRefs(
internalSwitchRef,
ref,
// @ts-expect-error figure out the correct type here
groupContext === null ? null : groupContext.setSwitch
)

Expand Down

0 comments on commit db58664

Please sign in to comment.