mirror of
https://github.com/zhigang1992/react.git
synced 2026-03-26 06:55:07 +08:00
feat(popover): add component
This commit is contained in:
@@ -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)()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user