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 HTMLButtonElement | null is not assignable to parameter of type HTMLElement | ReactElement<any, string | JSXElementConstructor<any>>
Type null is not assignable to type HTMLElement | ReactElement<any, string | JSXElementConstructor<any>>
I think the reason for this error is that the connector methods do not accept null as argument, but the ref can actually be null:
Indeed, I do know how to get around this problem, i.e. write drag(ref!) instead.
But I'm concerned that craft.js doesn't do anything special with null values, which could lead to problems that are currently invisible but could be far-reaching.
Describe the bug
When I write the simplest example code in typescript, I get the following error:
I think the reason for this error is that the connector methods do not accept null as argument, but the
ref
can actually be null:file: @types/react/index.d.ts
To Reproduce
Expected behavior
Screenshots
Additional context
Your environment
The text was updated successfully, but these errors were encountered: