We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 291033b commit 05a37a0Copy full SHA for 05a37a0
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