diff --git a/hooks/src/index.js b/hooks/src/index.js index 92eb1e113b..f2a0c12922 100644 --- a/hooks/src/index.js +++ b/hooks/src/index.js @@ -37,7 +37,7 @@ options._diff = vnode => { }; options._root = (vnode, parentDom) => { - if (parentDom._children && parentDom._children._mask) { + if (vnode && parentDom._children && parentDom._children._mask) { vnode._mask = parentDom._children._mask; } diff --git a/hooks/test/browser/useId.test.js b/hooks/test/browser/useId.test.js index fe2546fd1a..390f955df7 100644 --- a/hooks/test/browser/useId.test.js +++ b/hooks/test/browser/useId.test.js @@ -456,4 +456,25 @@ describe('useId', () => { '