From b478189fad48a64aa14959fc33142a130eec2ccf Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 23 May 2024 16:24:26 +0200 Subject: [PATCH] Mark `SwitchGroup` as deprecated, prefer `Field` instead (#3232) * mark `SwitchGroup` as deprecated Also updated the `Switch.Group` message to also prefer the `` component. * update changelog --- packages/@headlessui-react/CHANGELOG.md | 4 ++++ packages/@headlessui-react/src/components/switch/switch.tsx | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/@headlessui-react/CHANGELOG.md b/packages/@headlessui-react/CHANGELOG.md index eea24174dc..81d5825c63 100644 --- a/packages/@headlessui-react/CHANGELOG.md +++ b/packages/@headlessui-react/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [internal] Don’t set a focus fallback for Dialog’s in demo mode ([#3194](https://github.com/tailwindlabs/headlessui/pull/3194)) - Ensure page doesn't scroll down when pressing `Escape` to close the `Dialog` component ([#3218](https://github.com/tailwindlabs/headlessui/pull/3218)) +### Deprecated + +- Mark `SwitchGroup` as deprecated, prefer `Field` instead ([#3232](https://github.com/tailwindlabs/headlessui/pull/3232)) + ## [2.0.3] - 2024-05-07 ### Fixed diff --git a/packages/@headlessui-react/src/components/switch/switch.tsx b/packages/@headlessui-react/src/components/switch/switch.tsx index a5715dc7b8..e1080faded 100644 --- a/packages/@headlessui-react/src/components/switch/switch.tsx +++ b/packages/@headlessui-react/src/components/switch/switch.tsx @@ -269,6 +269,7 @@ export interface _internal_ComponentSwitchLabel extends _internal_ComponentLabel export interface _internal_ComponentSwitchDescription extends _internal_ComponentDescription {} let SwitchRoot = forwardRefWithAs(SwitchFn) as _internal_ComponentSwitch +/** @deprecated use `` instead of `` */ export let SwitchGroup = GroupFn as _internal_ComponentSwitchGroup /** @deprecated use `