wfp / designsystem

World Food Programme User Interface Kit. Developer kit for implementing WFP web style guideline.
http://www.wfp.org/UIGuide
Apache License 2.0
224 stars 103 forks source link

Wrong type definition for Tooltip - content prop #511

Open gguidotti opened 2 years ago

gguidotti commented 2 years ago

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