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

Function ListBoxSectionInner

packages/react-aria-components/src/ListBox.tsx:446–482  ·  view source on GitHub ↗
(
  props: ListBoxSectionProps<T>,
  ref: ForwardedRef<HTMLElement>,
  section: Node<T>,
  className = 'react-aria-ListBoxSection'
)

Source from the content-addressed store, hash-verified

444}
445
446function ListBoxSectionInner<T>(
447 props: ListBoxSectionProps<T>,
448 ref: ForwardedRef<HTMLElement>,
449 section: Node<T>,
450 className = 'react-aria-ListBoxSection'
451) {
452 let state = useContext(ListStateContext)!;
453 let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;
454 let {CollectionBranch} = useContext(CollectionRendererContext);
455 let [headingRef, heading] = useSlot();
456 let {headingProps, groupProps} = useListBoxSection({
457 heading,
458 'aria-label': props['aria-label'] ?? undefined
459 });
460 let renderProps = useRenderProps({
461 ...props,
462 id: undefined,
463 children: undefined,
464 defaultClassName: className,
465 values: undefined
466 });
467
468 let DOMProps = filterDOMProps(props as any, {global: true});
469 delete DOMProps.id;
470
471 return (
472 <dom.section {...mergeProps(DOMProps, renderProps, groupProps)} ref={ref}>
473 <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>
474 <CollectionBranch
475 collection={state.collection}
476 parent={section}
477 renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)}
478 />
479 </HeaderContext.Provider>
480 </dom.section>
481 );
482}
483
484/**
485 * A ListBoxSection represents a section within a ListBox.

Callers

nothing calls this directly

Calls 6

useSlotFunction · 0.90
useListBoxSectionFunction · 0.90
useRenderPropsFunction · 0.90
filterDOMPropsFunction · 0.90
mergePropsFunction · 0.90
useRenderDropIndicatorFunction · 0.90

Tested by

no test coverage detected