The type for the children prop of EuiTooltip is React.ReactElement<any>. It expects this because it does a React.cloneElement to create the anchor.
Because it is of this type and not React.ReactNode, you cannot pass a string as children to a tooltip, so:
<EuiToolTip>{someValue}</EuiToolTip>
has to become:
<EuiToolTip><>{someValue}</></EuiTooltip>
It would be nice if we were more flexible and allowed any React.ReactNode as children.
The type for the
childrenprop ofEuiTooltipisReact.ReactElement<any>. It expects this because it does aReact.cloneElementto create the anchor.Because it is of this type and not
React.ReactNode, you cannot pass a string as children to a tooltip, so:has to become:
It would be nice if we were more flexible and allowed any
React.ReactNodeas children.