(props: TextFieldProps)
| 11 | } |
| 12 | |
| 13 | export function TextField(props: TextFieldProps) { |
| 14 | let ref = useRef<HTMLInputElement>(null); |
| 15 | /*- begin highlight -*/ |
| 16 | let {labelProps, inputProps} = useTextField(props, ref); |
| 17 | /*- end highlight -*/ |
| 18 | let [isFocused, setFocused] = useState(false); |
| 19 | let {focusProps} = useFocus({onFocusChange: setFocused}); |
| 20 | |
| 21 | return ( |
| 22 | <div className="react-aria-TextField"> |
| 23 | <label className="react-aria-Label" {...labelProps}> |
| 24 | {props.label} |
| 25 | </label> |
| 26 | <input |
| 27 | {...mergeProps(inputProps, focusProps)} |
| 28 | ref={ref} |
| 29 | className="react-aria-Input inset" |
| 30 | data-focused={isFocused || undefined} |
| 31 | /> |
| 32 | </div> |
| 33 | ); |
| 34 | } |
nothing calls this directly
no test coverage detected