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

Function AsyncMenu

packages/react-aria-components/test/Menu.test.tsx:2107–2123  ·  view source on GitHub ↗
(props: {
      items?: typeof items;
      isLoading?: boolean;
      onLoadMore?: () => void;
    })

Source from the content-addressed store, hash-verified

2105 return <div>empty state</div>;
2106 };
2107 let AsyncMenu = (props: {
2108 items?: typeof items;
2109 isLoading?: boolean;
2110 onLoadMore?: () => void;
2111 }) => {
2112 let {items, isLoading, onLoadMore} = props;
2113 return (
2114 <Menu aria-label="async menu" renderEmptyState={() => renderEmptyState()}>
2115 <Collection items={items}>
2116 {item => <MenuItem id={item.name}>{item.name}</MenuItem>}
2117 </Collection>
2118 <MenuLoadMoreItem isLoading={isLoading} onLoadMore={onLoadMore}>
2119 Loading...
2120 </MenuLoadMoreItem>
2121 </Menu>
2122 );
2123 };
2124
2125 let onLoadMore = jest.fn();
2126 let observe = jest.fn();

Callers

nothing calls this directly

Calls 1

renderEmptyStateFunction · 0.70

Tested by

no test coverage detected