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

Function apply

packages/@react-spectrum/ai/src/TokenField.tsx:103–109  ·  view source on GitHub ↗
(fn: (value: TokenSegmentList) => TokenSegmentList)

Source from the content-addressed store, hash-verified

101 let transferredData = useRef<TokenFieldSegment[] | null>(null);
102
103 let apply = (fn: (value: TokenSegmentList) => TokenSegmentList) => {
104 setState(value => {
105 let newValue = fn(value);
106 onAutocompleteChange?.(newValue.toString());
107 return newValue;
108 });
109 };
110
111 let caretPosition = useRef<Position | null>(null);
112 useLayoutEffect(() => {

Callers 2

TokenField.tsxFile · 0.85
writeClipboardDataFunction · 0.85

Calls 2

fnFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected