Skip to content

Commit 22d52cf

Browse files
authored
useTextField: Fix typings for labelProp (htmlFor) (#3671)
match return type of useLabel for useTextfield
1 parent 1ed3d4a commit 22d52cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@react-aria/textfield/src/useTextField.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
ChangeEvent,
1616
DOMFactory,
1717
HTMLAttributes,
18+
LabelHTMLAttributes,
1819
ReactDOM,
1920
RefObject
2021
} from 'react';
@@ -88,7 +89,7 @@ export interface TextFieldAria<T extends TextFieldIntrinsicElements = DefaultEle
8889
/** Props for the input element. */
8990
inputProps: TextFieldInputProps<T>,
9091
/** Props for the text field's visible label element, if any. */
91-
labelProps: DOMAttributes,
92+
labelProps: DOMAttributes | LabelHTMLAttributes<HTMLLabelElement>,
9293
/** Props for the text field's description element, if any. */
9394
descriptionProps: DOMAttributes,
9495
/** Props for the text field's error message element, if any. */

0 commit comments

Comments
 (0)