chore: fix isValidElement
parent
bbc6c29e69
commit
fc206c7e55
|
@ -252,7 +252,11 @@ export function mergeProps () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isValidElement (element) {
|
function isValidElement (element) {
|
||||||
return element && typeof element === 'object' && ('componentOptions' in element && 'context' in element)
|
return element &&
|
||||||
|
typeof element === 'object' &&
|
||||||
|
'componentOptions' in element &&
|
||||||
|
'context' in element &&
|
||||||
|
element.tag !== undefined // remove text node
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
|
@ -4,7 +4,11 @@ exports[`renders ./components/tooltip/demo/arrow-point-at-center.md correctly 1`
|
||||||
|
|
||||||
exports[`renders ./components/tooltip/demo/auto-adjust-overflow.md correctly 1`] = `<div style="overflow: hidden; position: relative; padding: 24px; border: 1px solid #e9e9e9;"><button type="button" class="ant-btn ant-btn-default"><span>Adjust automatically / 自动调整</span></button> <br> <button type="button" class="ant-btn ant-btn-default" style="margin-top: 10px;"><span>Ingore / 不处理</span></button></div>`;
|
exports[`renders ./components/tooltip/demo/auto-adjust-overflow.md correctly 1`] = `<div style="overflow: hidden; position: relative; padding: 24px; border: 1px solid #e9e9e9;"><button type="button" class="ant-btn ant-btn-default"><span>Adjust automatically / 自动调整</span></button> <br> <button type="button" class="ant-btn ant-btn-default" style="margin-top: 10px;"><span>Ingore / 不处理</span></button></div>`;
|
||||||
|
|
||||||
exports[`renders ./components/tooltip/demo/basic.md correctly 1`] = `undefined`;
|
exports[`renders ./components/tooltip/demo/basic.md correctly 1`] = `
|
||||||
|
<span class="">
|
||||||
|
Tooltip will show when mouse enter.
|
||||||
|
</span>
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
|
exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
|
||||||
<div id="components-a-tooltip-demo-placement">
|
<div id="components-a-tooltip-demo-placement">
|
||||||
|
|
Loading…
Reference in New Issue