Skip to content

Commit

Permalink
fix(field-label): deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroslavPetrik committed Feb 14, 2024
1 parent 05060f6 commit c911db5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/field-label/Docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import renderProps from "./renderProps.md?raw";

<Meta title="components/atomic/FieldLabel" />

# 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.
<Description of={FieldLabelStories} />
<Canvas sourceState="none" of={FieldLabelStories.Primary} />
Expand Down
1 change: 1 addition & 0 deletions src/components/field-label/FieldLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type FieldLabelProps<Field extends FieldAtom<any>> = {

/**
* 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 extends FieldAtom<any>>({
field,
Expand Down

0 comments on commit c911db5

Please sign in to comment.