Skip to content

Commit b478189

Browse files
authored
Mark SwitchGroup as deprecated, prefer Field instead (#3232)
* mark `SwitchGroup` as deprecated Also updated the `Switch.Group` message to also prefer the `<Field>` component. * update changelog
1 parent 7fcb410 commit b478189

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/@headlessui-react/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- [internal] Don’t set a focus fallback for Dialog’s in demo mode ([#3194](https://github.com/tailwindlabs/headlessui/pull/3194))
1313
- Ensure page doesn't scroll down when pressing `Escape` to close the `Dialog` component ([#3218](https://github.com/tailwindlabs/headlessui/pull/3218))
1414

15+
### Deprecated
16+
17+
- Mark `SwitchGroup` as deprecated, prefer `Field` instead ([#3232](https://github.com/tailwindlabs/headlessui/pull/3232))
18+
1519
## [2.0.3] - 2024-05-07
1620

1721
### Fixed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,15 @@ export interface _internal_ComponentSwitchLabel extends _internal_ComponentLabel
269269
export interface _internal_ComponentSwitchDescription extends _internal_ComponentDescription {}
270270

271271
let SwitchRoot = forwardRefWithAs(SwitchFn) as _internal_ComponentSwitch
272+
/** @deprecated use `<Field>` instead of `<SwitchGroup>` */
272273
export let SwitchGroup = GroupFn as _internal_ComponentSwitchGroup
273274
/** @deprecated use `<Label>` instead of `<SwitchLabel>` */
274275
export let SwitchLabel = Label as _internal_ComponentSwitchLabel
275276
/** @deprecated use `<Description>` instead of `<SwitchDescription>` */
276277
export let SwitchDescription = Description as _internal_ComponentSwitchDescription
277278

278279
export let Switch = Object.assign(SwitchRoot, {
279-
/** @deprecated use `<SwitchGroup>` instead of `<Switch.Group>` */
280+
/** @deprecated use `<Field>` instead of `<Switch.Group>` */
280281
Group: SwitchGroup,
281282
/** @deprecated use `<Label>` instead of `<Switch.Label>` */
282283
Label: SwitchLabel,

0 commit comments

Comments
 (0)