question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-split 2.0.13 Typescript "extends" incompatible

See original GitHub issue

In react-split’s SplitProps interface you removed className?: string in favour of extending from React.HTMLAttributes<HTMLDivElement>.

(see https://github.com/nathancahill/split/issues/689 and https://github.com/nathancahill/split/commit/e18c3a07dc607725c708b2c476dff52f9b515142)

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> {

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
nathancahillcommented, Jan 7, 2022

Sorry yes, just published as v2.0.14.

0reactions
RKim220commented, Jan 4, 2022

@nathancahill Anything needed to get this published? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Split.js - Bountysource
Hi @nathancahill I have a 3 div setup. If for example I'm increasing the right div, I want the mid div to move...
Read more >
React TypeScript: Types of property 'X' are incompatible. Type ...
I am working on React-TypeScript app, creating credit card number imput ... export default class CardNumber extends Component<IProps,IState > ...
Read more >
react-split - npm
The <Split /> component wraps multiple children components to create a resizeable split view. The component is a light wrapper around the Split....
Read more >
React-universal-component - npm.io
DEFINITION: "Universal Rendering" is simultaneous SSR + Splitting, not trading one for the other. Gone are the days of holding onto file hashes,...
Read more >
Release notes - Riot.js
Fix textarea inconsistent updates on IE riot#1959 ... Fix mixins using child class functions ( class Child extends Parent {} ) riot#1857 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found