react-tooltip
react-tooltip copied to clipboard
ReactTooltip next.js dynamic import with typescript
As you can see on the image above dynamically imported react-tooltip component doesn't show any of its static methods or TooltipProps for that matter. When component is directly imported from react-tooltip it returns the ReactTooltip class that extends React.Component<TooltipProps> but when it is imported dynamically with next.js it returns React.ComponentType<TooltipProps> as seen below.
Because of typescript compiler I cannot use rebuild method now when I need to. Also from what I see next.js dynamic always returns React.ComponentType so I cannot change the return type to be ReactTooltip class. Is there a way around this (while still using dynamic import)?