reactjs-popup
reactjs-popup copied to clipboard
Element' is not assignable to type 'ReactNode'.ts(2322)
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
Here is a clean view of the code
(property) JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
Type '(close: any) => Element' is not assignable to type 'ReactNode'.ts(2322)
I got the same issue
Same here.
Try this workaround.
I don't like ignoring ts but thanks anyway
Why is this typescript bug still exists? My version is: 2.0.5
Try this workaround.
thank
Try this workaround.
Legend. This has been puzzling me for hours