We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2996495 commit 66602a8Copy full SHA for 66602a8
packages/compass-crud/src/components/document.jsx
@@ -14,7 +14,9 @@ const Document = (props) => {
14
} = props;
15
16
const doc = useMemo(() => {
17
- if (_doc?.isRoot?.()) {
+ // COMPASS-5872 If _doc is a plain js object rather than an instance of hadron-document Document
18
+ // it may have an isRoot prop, which would cause the isRoot() to throw an error.
19
+ if (typeof _doc?.isRoot === 'function' && _doc?.isRoot()) {
20
return _doc;
21
}
22
return new HadronDocument(_doc);
0 commit comments