Skip to content

Commit

Permalink
mark SwitchGroup as deprecated
Browse files Browse the repository at this point in the history
Also updated the `Switch.Group` message to also prefer the `<Field>`
component.
  • Loading branch information
RobinMalfait committed May 22, 2024
1 parent 7fcb410 commit ead3f53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/@headlessui-react/src/components/switch/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,15 @@ export interface _internal_ComponentSwitchLabel extends _internal_ComponentLabel
export interface _internal_ComponentSwitchDescription extends _internal_ComponentDescription {}

let SwitchRoot = forwardRefWithAs(SwitchFn) as _internal_ComponentSwitch
/** @deprecated use `<Field>` instead of `<SwitchGroup>` */
export let SwitchGroup = GroupFn as _internal_ComponentSwitchGroup
/** @deprecated use `<Label>` instead of `<SwitchLabel>` */
export let SwitchLabel = Label as _internal_ComponentSwitchLabel
/** @deprecated use `<Description>` instead of `<SwitchDescription>` */
export let SwitchDescription = Description as _internal_ComponentSwitchDescription

export let Switch = Object.assign(SwitchRoot, {
/** @deprecated use `<SwitchGroup>` instead of `<Switch.Group>` */
/** @deprecated use `<Field>` instead of `<Switch.Group>` */
Group: SwitchGroup,
/** @deprecated use `<Label>` instead of `<Switch.Label>` */
Label: SwitchLabel,
Expand Down

0 comments on commit ead3f53

Please sign in to comment.