Skip to content

Wrong type definition for Tooltip - content prop #511

@gguidotti

Description

@gguidotti

Detailed description

Describe in detail the issue you're having.
When using the Tooltip component, if I use a function as the "content" prop (eg. <Tooltip content={() => renderSomething()} />) I get a warning about expecting a ReactNode type and getting a function instead. I believe this should be covered since even the Tooltip component itself contains a check about the type of "content" prop being a function or not (https://github.com/wfp/designsystem/blob/next/src/components/Tooltip/Tooltip.js#L109).

Is this issue related to a specific component?
Tooltip

What did you expect to happen? What happened instead? What would you like to see changed?
Enrich type definition by adding "function" type.
No warning shown.

What version of the WFP UI (Carbon Design System) are you using?
@wfp/ui@1.20.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions