react-split 2.0.13 Typescript "extends" incompatible
baumerdev opened this issue · 9 comments
In react-split's SplitProps interface you removed className?: string
in favour of extending from React.HTMLAttributes<HTMLDivElement>
.
The problem is, that some types in SplitProps have the same names as in @types/react's React.HTMLAttributes<HTMLDivElement>
but different definitions, like onDrag
SplitProps: onDrag?: Options["onDrag"]
DOMAttributes (which HTMLAttributes extends from): onDrag?: DragEventHandler<T> | undefined;
And that can generate errors like this:
Interface 'SplitProps' incorrectly extends interface 'HTMLAttributes<HTMLDivElement>'.
Types of property 'onDrag' are incompatible.
Type '((sizes: number[]) => void) | undefined' is not assignable to type 'DragEventHandler<HTMLDivElement> | undefined'.
Type '(sizes: number[]) => void' is not assignable to type 'DragEventHandler<HTMLDivElement>'.
Types of parameters 'sizes' and 'event' are incompatible.
Type 'DragEvent<HTMLDivElement>' is missing the following properties from type 'number[]': length, pop, push, concat, and 28 more.
export interface SplitProps extends React.HTMLAttributes<HTMLDivElement> {
Right you are. We'll have to Omit<>
and then extend
.
same issue
now how can i solve this?
bro fix this issue please!
I second the need to fix this. It looks like there is already an open PR for this. Is there anything else we can help with in order to have this fixed?
Hi guys, sorry for the delay, have a newborn at home. I'd love help maintaining this library if anyone is interested. We already have 4 maintainers with push access, but I'd love to add more. @catdad if you're interested?
@nathancahill Looks like @baumerdev's PR was merged into master
. Can we get react-split
published to npm?
@nathancahill Anything needed to get this published? Thanks!
Sorry yes, just published as v2.0.14.