Skip to content

Update TooltipControllerTypes.d.ts #1202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/TooltipController/TooltipControllerTypes.d.ts
Original file line number Diff line number Diff line change
@@ -17,11 +17,11 @@ import type {
export interface ITooltipController {
className?: string
classNameArrow?: string
content?: string
content?: string | JSX.Element
/**
* @deprecated Use `children` or `render` instead
*/
html?: string
html?: string | JSX.Element
render?: (render: { content: string | null; activeAnchor: HTMLElement | null }) => ChildrenType
place?: PlacesType
offset?: number

Unchanged files with check annotations Beta

if (render) {
const actualContent =
activeAnchor?.getAttribute('data-tooltip-content') || tooltipContent || null
const rendered = render({ content: actualContent, activeAnchor }) as React.ReactNode

Check failure on line 320 in src/components/TooltipController/TooltipController.tsx

GitHub Actions / bundlesize / bundlesize

Type 'string | Element | null' is not assignable to type 'string | null'.
renderedContent = rendered ? (
<div ref={contentWrapperRef} className="react-tooltip-content-wrapper">
{rendered}
renderedContent = tooltipContent
}
if (tooltipHtml) {
renderedContent = <TooltipContent content={tooltipHtml} />

Check failure on line 330 in src/components/TooltipController/TooltipController.tsx

GitHub Actions / bundlesize / bundlesize

Type 'string | Element' is not assignable to type 'string'.
}
const props: ITooltip = {