MCPcopy
hub / github.com/adobe/react-spectrum / Wrapper

Function Wrapper

packages/react-aria/src/collections/Hidden.tsx:87–94  ·  view source on GitHub ↗
(props: P, ref: React.Ref<T>)

Source from the content-addressed store, hash-verified

85 fn: (props: P, ref: React.Ref<T>) => ReactElement | null
86): (props: P & React.RefAttributes<T>) => ReactElement | null {
87 let Wrapper = (props: P, ref: React.Ref<T>) => {
88 let isHidden = useContext(HiddenContext);
89 if (isHidden) {
90 return null;
91 }
92
93 return fn(props, ref);
94 };
95 // @ts-ignore - for react dev tools
96 Wrapper.displayName = fn.displayName || fn.name;
97 return (forwardRef as forwardRefType)(Wrapper);

Callers

nothing calls this directly

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected