reactjs-popup icon indicating copy to clipboard operation
reactjs-popup copied to clipboard

Element' is not assignable to type 'ReactNode'.ts(2322)

Open MudulOzan opened this issue 2 years ago • 8 comments

Hi, we have been using reactjs-popup and it worked well so far thanks for the great effort. However, due to the complicated configs of my current project that I am not fond of, giving me strange error while the same code works in another project. I am not quite sure why this is happening and probably not because of this library but I thought I could get some guidance here.

I got this error before and I cloned the project to somewhere else, a different folder and it worked like magic. However I applied the same technique in another project, exactly under the same folder just like I with my previous project that I was getting the same error, it wasn't a successful approach. Now I am stuck with this and I don't want to go ts files and change interface to any. What am I missing?

Version

2.0.5

Test Case

https://codesandbox.io/s/wispy-mountain-m9nfym?file=/src/App.tsx

Expected Behavior

Should not give a type error

Actual Behavior

Here is the error image Here is a clean view of the code code

(property) JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
Type '(close: any) => Element' is not assignable to type 'ReactNode'.ts(2322)

MudulOzan avatar Jun 24 '22 11:06 MudulOzan

I got the same issue

sammelanyogi avatar Jul 10 '22 14:07 sammelanyogi

Same here.

Xtr102 avatar Jul 29 '22 12:07 Xtr102

Try this workaround.

螢幕擷取畫面 2022-09-02 113515

DwaveVito avatar Sep 02 '22 03:09 DwaveVito

I don't like ignoring ts but thanks anyway

MudulOzan avatar Oct 12 '22 14:10 MudulOzan

Why is this typescript bug still exists? My version is: 2.0.5

qaws5503 avatar Sep 22 '23 09:09 qaws5503

Try this workaround.

螢幕擷取畫面 2022-09-02 113515

thank

pimpawell avatar Oct 03 '23 23:10 pimpawell

Try this workaround.

螢幕擷取畫面 2022-09-02 113515

Legend. This has been puzzling me for hours

KieranJamess avatar Oct 23 '23 19:10 KieranJamess