Skip to content

Commit 34a03a0

Browse files
committed
chore: clean code
1 parent f45efa7 commit 34a03a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Tooltip.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ const Tooltip = (props: TooltipProps, ref: React.Ref<TooltipRef>) => {
115115
);
116116

117117
const getChildren = () => {
118-
const originalProps = (children as React.ReactElement)?.props || {};
118+
const child = React.Children.only(children);
119+
const originalProps = child?.props || {};
119120

120121
const childProps = {
121122
...originalProps,

0 commit comments

Comments
 (0)