We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3013156 commit 8cb1a5dCopy full SHA for 8cb1a5d
packages/react-aria-components/docs/TagGroup.mdx
@@ -707,9 +707,9 @@ import {ListStateContext} from 'react-aria-components';
707
708
function SelectionCount() {
709
/*- begin highlight -*/
710
- let state = React.useContext(ListStateContext)!;
+ let state = React.useContext(ListStateContext);
711
/*- end highlight -*/
712
- let selected = state.selectionManager.selectedKeys.size;
+ let selected = state?.selectionManager.selectedKeys.size ?? 0;
713
return <small>{selected} tags selected.</small>;
714
}
715
0 commit comments