question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'ReactTooltip' cannot be used as a JSX component.

See original GitHub issue
(alias) class ReactTooltip
import ReactTooltip
'ReactTooltip' cannot be used as a JSX component.
  Its instance type 'ReactTooltip' is not a valid JSX element.
    Type 'ReactTooltip' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.ts(2786)

Can’t seem to use it as just <ReactTooltip /> in my tsx code.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:14

github_iconTop GitHub Comments

4reactions
redhaircommented, Apr 15, 2022

+1

Similar issue here. Just popped up this morning. Wondering if it was some downstream dependency that changed. Here is the full stack trace:

'ReactTooltip' cannot be used as a JSX component.
  Its instance type 'ReactTooltip' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'React.ReactNode' is not assignable to type 'import("/Code/interface/node_modules/@types/react-helmet/node_modules/@types/react/index").ReactNode'.
        Type '{}' is not assignable to type 'ReactNode'.
          Type '{}' is missing the following properties from type 'ReactPortal': key, children, type, props

Edit: This solved my issue - https://stackoverflow.com/questions/71791347/npm-package-cannot-be-used-as-a-jsx-component-type-errors/71828113#71828113

3reactions
moseswebcommented, May 19, 2022

Same issue here. Even with @types/react-tooltip installed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'ReactTooltip' cannot be used as a JSX component. · Issue #624
Its instance type 'ReactTooltip' is not a valid JSX element. ... 'ReactTooltip' cannot be used as a JSX component. #624.
Read more >
NPM package cannot be used as a JSX Component
I'm getting similar "TS2786: 'NumberFormat' cannot be used as a JSX component. Its instance type 'NumberFormat<unknown>' is not a valid JSX ...
Read more >
Component from NPM module cannot be used as a JSX ...
I encountered this problem recently with 2 modules so far: react-tooltip and react-dates. Note: this issue only occurs if you are using TypeScript...
Read more >
Component cannot be used as a JSX component in React
The error Component cannot be used as a JSX component occurs for multiple reasons, returning an array of JSX elements instead of a...
Read more >
cannot be used as a jsx component. its return type 'reactnode ...
React class component cannot be used as a JSX component if returns type of ReactNode ... Its instance type 'ReactTooltip' is not a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found