only check if _mainTreeNodeRef is passed in (Vue)

It can be that it is passed in but still `null`, that's fine because it
 means it will be passed in later once the DOM is ready.
This commit is contained in:
Robin Malfait
2023-08-02 13:45:41 +02:00
parent a3fa86b6f4
commit 4f6f67c488
@@ -1,4 +1,4 @@
import { ref, h, Ref, computed } from 'vue'
import { ref, h, Ref } from 'vue'
import { Hidden, Features as HiddenFeatures } from '../internal/hidden'
import { getOwnerDocument } from '../utils/owner'
import { dom } from '../utils/dom'
@@ -58,8 +58,7 @@ export function useRootContainers({
},
mainTreeNodeRef,
MainTreeNode() {
let hasPassedInMainTreeNode = (_mainTreeNodeRef?.value ?? null) !== null
if (hasPassedInMainTreeNode) return null
if (_mainTreeNodeRef != null) return null
return h(Hidden, { features: HiddenFeatures.Hidden, ref: mainTreeNodeRef })
},
}