Skip to content

Commit 1bb66d0

Browse files
authored
fix(compass-crud): Hide table document views when there are no documents (#3404)
1 parent abea8a8 commit 1bb66d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/compass-crud/src/components/document-list.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ class DocumentList extends React.Component {
9292
* @returns {React.Component} The document list views.
9393
*/
9494
renderViews() {
95+
if (this.props.docs?.length === 0) {
96+
return null;
97+
}
98+
9599
if (this.props.view === 'List') {
96100
return <DocumentListView {...this.props} />;
97101
} else if (this.props.view === 'Table') {

0 commit comments

Comments
 (0)