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
TS2345: Argument of type InputSwitch is not assignable to parameter of type HTMLElement | ReactElement<any, string | JSXElementConstructor<any>>
Type InputSwitch is missing the following properties from type ReactElement<any, string | JSXElementConstructor<any>>
: type, key
Inside PrimeReact, the base type of ref is React.Component, not React.ReactElement:
And not all components have the getElement() method.
I could forcefully ignore the typescript error with the any type, but I don't know how much of an impact it would have, especially the ones that can't be found at the moment.
To Reproduce
Expected behavior
Screenshots
Additional context
Your environment
Software
Version(s)
craft.js
0.2.2
React
18.2.0
TypeScript
5.2.2
Browser
-
npm/Yarn
-
Operating System
-
The text was updated successfully, but these errors were encountered:
I could also wrap PrimeReact component with a div so that I only have to get the ref of the div and not the PrimeReact component.
But this approach also has a major drawback, it makes the DOM structure more complex and performance worse.
Describe the bug
When I write the simple sample code below, I get the following error:
Inside
PrimeReact
, the base type ofref
isReact.Component
, notReact.ReactElement
:And not all components have the
getElement()
method.I could forcefully ignore the typescript error with the
any
type, but I don't know how much of an impact it would have, especially the ones that can't be found at the moment.To Reproduce
Expected behavior
Screenshots
Additional context
Your environment
The text was updated successfully, but these errors were encountered: