score:9

Accepted answer

You could simply cast the tooltip.node() as any to get around this:

const toolTipWidth = (tooltip.node() as any).getBoundingClientRect().width;

Correct type should be probably HTMLElement, that should work too:

const toolTipWidth = (tooltip.node() as HTMLElement).getBoundingClientRect().width;

Related Query

More Query from same tag