MCPcopy Index your code
hub / github.com/adobe/react-spectrum / composeRenderProps

Function composeRenderProps

packages/react-aria-components/src/utils.tsx:273–279  ·  view source on GitHub ↗
(
  // https://stackoverflow.com/questions/60898079/typescript-type-t-or-function-t-usage
  value: T extends any ? T | ((renderProps: U) => V) : never,
  wrap: (prevValue: T, renderProps: U) => V
)

Source from the content-addressed store, hash-verified

271 * function), and combines it with another value to create a final result.
272 */
273export function composeRenderProps<T, U, V extends T>(
274 // https://stackoverflow.com/questions/60898079/typescript-type-t-or-function-t-usage
275 value: T extends any ? T | ((renderProps: U) => V) : never,
276 wrap: (prevValue: T, renderProps: U) => V
277): (renderProps: U) => V {
278 return renderProps => wrap(typeof value === 'function' ? value(renderProps) : value, renderProps);
279}
280
281export type WithRef<T, E> = T & {ref?: ForwardedRef<E>};
282export interface SlotProps {

Callers 15

TabsFunction · 0.90
TabListFunction · 0.90
TabFunction · 0.90
TabPanelFunction · 0.90
HorizontalCard.tsxFile · 0.85
Popover.tsxFile · 0.85
CustomDialog.tsxFile · 0.85
TextField.tsxFile · 0.85
Dialog.tsxFile · 0.85
Card.tsxFile · 0.85

Calls 1

wrapFunction · 0.85

Tested by

no test coverage detected