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

Function Wrapper

packages/react-aria/src/collections/Hidden.tsx:87–95  ·  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 // oxlint-disable-next-line react/react-compiler
94 return fn(props, ref);
95 };
96 // @ts-ignore - for react dev tools
97 Wrapper.displayName = fn.displayName || fn.name;
98 return (forwardRef as forwardRefType)(Wrapper);

Callers

nothing calls this directly

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected