MCPcopy Create free account
hub / github.com/adobe/react-spectrum / useTimeField

Function useTimeField

packages/react-aria/src/datepicker/useDateField.ts:244–253  ·  view source on GitHub ↗
(
  props: AriaTimeFieldOptions<T>,
  state: TimeFieldState,
  ref: RefObject<Element | null>
)

Source from the content-addressed store, hash-verified

242 * Each part of a time value is displayed in an individually editable segment.
243 */
244export function useTimeField<T extends TimeValue>(
245 props: AriaTimeFieldOptions<T>,
246 state: TimeFieldState,
247 ref: RefObject<Element | null>
248): DateFieldAria {
249 let res = useDateField(props, state, ref);
250 // oxlint-disable-next-line react/react-compiler
251 res.inputProps.value = state.timeValue?.toString() || '';
252 return res;
253}

Callers 3

DateField.tsxFile · 0.85
TimeField.tsxFile · 0.85
TimeFieldFunction · 0.85

Calls 2

useDateFieldFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected