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

Function AsyncListbox

packages/react-aria-components/test/ListBox.test.js:2107–2122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2105 return <div>empty state</div>;
2106 };
2107 let AsyncListbox = props => {
2108 let {items, isLoading, onLoadMore, ...listBoxProps} = props;
2109 return (
2110 <ListBox
2111 {...listBoxProps}
2112 aria-label="async listbox"
2113 renderEmptyState={() => renderEmptyState()}>
2114 <Collection items={items}>
2115 {item => <ListBoxItem id={item.name}>{item.name}</ListBoxItem>}
2116 </Collection>
2117 <ListBoxLoadMoreItem isLoading={isLoading} onLoadMore={onLoadMore}>
2118 Loading...
2119 </ListBoxLoadMoreItem>
2120 </ListBox>
2121 );
2122 };
2123
2124 let onLoadMore = jest.fn();
2125 let observe = jest.fn();

Callers

nothing calls this directly

Calls 1

renderEmptyStateFunction · 0.70

Tested by

no test coverage detected