feat(popover): add component

This commit is contained in:
unix
2020-04-08 07:52:28 +08:00
parent 1758f73ecd
commit c736d84d10
7 changed files with 423 additions and 0 deletions

View File

@@ -101,3 +101,12 @@ export const setChildrenIndex = (
return item
})
}
export const getReactNode = (
node?: React.ReactNode | (() => React.ReactNode),
): React.ReactNode => {
if (!node) return null
if (typeof node !== 'function') return node
return (node as () => React.ReactNode)()
}