react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

Its instance type 'ReactTooltip' is not a valid JSX element.

Open DenisStoliarchuk opened this issue 2 years ago • 4 comments

Few days ago newest version of React tooltip return error '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("/node_modules/@types/react-dom/node_modules/@types/react/index").ReactNode'. TS2786

  > 68 |                        <ReactTooltip />
       |                         ^
    69 |                </>
    70 |        );
    71 |
    
I added pull request with potential fix, please take a look @wwayne or anyone else

DenisStoliarchuk avatar Apr 12 '22 07:04 DenisStoliarchuk

@aronhelser please check it and my PR, maybe you will be able to update npm library with this potential fix, also @wwayne send me link with fix that works for me https://stackoverflow.com/a/71828113/3404325

DenisStoliarchuk avatar Apr 13 '22 09:04 DenisStoliarchuk

Any solution for npm users sorry?

ronakiihglobal avatar Apr 18 '22 12:04 ronakiihglobal

@ronakiihglobal Only for yarn!

"resolutions": { "@types/react": "16.9.53", "@types/react-dom": "16.9.8" }

put this in your package.json and use yarn for install

DenisStoliarchuk avatar Apr 18 '22 12:04 DenisStoliarchuk

Any fixes/updates for npm will be helpful! Thanks in advance.

ronakiihglobal avatar May 02 '22 13:05 ronakiihglobal

Hi @DenisGold, is that one solved, right?

Can be closed?

danielbarion avatar Oct 14 '22 14:10 danielbarion

Hi Daniel, works perfect! you can close it, thanks

DenisStoliarchuk avatar Oct 14 '22 14:10 DenisStoliarchuk