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

Function ClearButton

starters/hooks/src/SearchField.tsx:46–61  ·  view source on GitHub ↗
(props: AriaButtonProps)

Source from the content-addressed store, hash-verified

44}
45
46function ClearButton(props: AriaButtonProps) {
47 let ref = useRef<HTMLButtonElement>(null);
48 // useButton turns the AriaButtonProps from useSearchField into DOM props for the clear button.
49 let {buttonProps, isPressed} = useButton(props, ref);
50
51 return (
52 <button
53 {...buttonProps}
54 ref={ref}
55 className="clear-button"
56 data-pressed={isPressed || undefined}
57 data-disabled={props.isDisabled || undefined}>
58 {props.children}
59 </button>
60 );
61}

Callers

nothing calls this directly

Calls 1

useButtonFunction · 0.90

Tested by

no test coverage detected