You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
After upgrading to the latest version of react-tooltip, I encountered a TypeScript error in the library’s type definitions. The issue is caused by a reference to React.JSX in the TooltipWrapper declaration, which is not supported in React 17 projects using @types/react v17.
Upon investigation, I noticed that starting from react-tooltip@v5.20.0, the library updated its @types/react dev dependency from 18.0.28 to ^18.2.17. This change introduces compatibility issues for projects still using @types/react v17.
Could you please confirm if this dependency bump is strictly necessary? Upgrading @types/react in my current setup is not straightforward.
I'm not sure how relevant it would be for us to provide this level of backwards compatibility, but we will keep it mind.
A relatively easy fix in your case would be to use something like patch-package to fix it "manually" (substitute the React.JSX references to use the old syntax) in that specific codebase.
Using patch-package isn’t a viable option in my specific case, as there are other projects consuming the components, and I’d need to ensure that those projects also install it for the patch to take effect consistently. While it technically works, it’s not practical in my setup.
At this point, I’m leaning toward reverting to an earlier version of the react-tooltip library—one that doesn’t include the @types/react changes.
Bug description
After upgrading to the latest version of react-tooltip, I encountered a TypeScript error in the library’s type definitions. The issue is caused by a reference to React.JSX in the TooltipWrapper declaration, which is not supported in React 17 projects using @types/react v17.
Upon investigation, I noticed that starting from react-tooltip@v5.20.0, the library updated its @types/react dev dependency from 18.0.28 to ^18.2.17. This change introduces compatibility issues for projects still using @types/react v17.
Could you please confirm if this dependency bump is strictly necessary? Upgrading @types/react in my current setup is not straightforward.
Environment
To Reproduce
Expected behavior
No errors to be reported. Typescript should build successfully
Actual Behavior
Error: node_modules/react-tooltip/dist/react-tooltip.d.ts:250:193 - error TS2694: Namespace 'React' has no exported member 'JSX'.
The text was updated successfully, but these errors were encountered: