From c911db5a43fa405d44b106c615aeed7f0eccf928 Mon Sep 17 00:00:00 2001 From: Miroslav Petrik Date: Wed, 14 Feb 2024 16:05:15 +0100 Subject: [PATCH] fix(field-label): deprecate --- src/components/field-label/Docs.mdx | 5 ++++- src/components/field-label/FieldLabel.tsx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/field-label/Docs.mdx b/src/components/field-label/Docs.mdx index 1a33db3..547b138 100644 --- a/src/components/field-label/Docs.mdx +++ b/src/components/field-label/Docs.mdx @@ -13,7 +13,10 @@ import renderProps from "./renderProps.md?raw"; -# FieldLabel +# (deprecated) FieldLabel + +> [!NOTE] +> Deprecated as the atomKey used for `htmlFor` is not compatible with SSR. Use the `useId` hook instead, or what your UI library provides. diff --git a/src/components/field-label/FieldLabel.tsx b/src/components/field-label/FieldLabel.tsx index 29110ed..939c9f7 100644 --- a/src/components/field-label/FieldLabel.tsx +++ b/src/components/field-label/FieldLabel.tsx @@ -15,6 +15,7 @@ type FieldLabelProps> = { /** * Renders an accessible label controlling the field's input. + * @deprecated The atomKey is not suitable for input/label pairing as it does not support SSR. Moreover the onMouseDown is UX feature, not a logic concern for a field. */ export const FieldLabel = >({ field,