chore(Tooltip): converted examples to typescript
What: Closes #8029 . TypeScript examples for Tooltip.
Additional issues:
Firstly, in lines 37, 50, 63, and 76 of TooltipOptions.tsx, is this good practice? I was thinking of typing updatedTrigger as let updatedTrigger: string[] = []; as a result of what the expected input should be.
Preview: https://patternfly-react-pr-8052.surge.sh
A11y report: https://patternfly-react-pr-8052-a11y.surge.sh
The main issue I'm running into is lines 109 (setPosition(selection)) and 170 (setFlipBehavior(selection)). The error I am seeing is
Argument of type 'string | SelectOptionObject' is not assignable to parameter of type 'SetStateAction<TooltipPosition>'.
Type 'string' is not assignable to type 'SetStateAction<TooltipPosition>'.
This is due to Select component onSelect prop method taking in value: string | SelectOptionObject whereas setPosition and setFlipBehavior have the type (value: React.SetStateAction<TooltipPosition>) => void. I'm unsure how to convert the string or SelectOptionObject to this type
@andyyvo I'm going to update this PR with the tiny change to move it along :)
Your changes have been released in:
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- [email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
Thanks for your contribution! :tada: