Skip to content

Allow strings for EuiToolTip children #2292

@smith

Description

@smith

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    design decisionUse this to flag an item that needs input from the design team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions