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

Function mergeDialogContext

packages/react-aria-components/src/Modal.tsx:379–391  ·  view source on GitHub ↗
(
  context: ContextValue<DialogProps, HTMLElement>,
  props: Partial<DialogProps>
)

Source from the content-addressed store, hash-verified

377}
378
379function mergeDialogContext(
380 context: ContextValue<DialogProps, HTMLElement>,
381 props: Partial<DialogProps>
382): ContextValue<DialogProps, HTMLElement> {
383 if (context && 'slots' in context && context.slots) {
384 let slots = {};
385 for (let key in context.slots) {
386 slots[key] = {...context.slots[key], ...props};
387 }
388 return {...context, slots};
389 }
390 return {...context, ...props};
391}
392
393interface ModalContentProps
394 extends RenderProps<ModalRenderProps>, GlobalDOMAttributes<HTMLDivElement> {

Callers 1

ModalOverlayInnerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected