Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript error on 3.7.5 #192

Open
Anahkiasen opened this issue Mar 10, 2020 · 1 comment
Open

Typescript error on 3.7.5 #192

Anahkiasen opened this issue Mar 10, 2020 · 1 comment
Labels

Comments

@Anahkiasen
Copy link

Anahkiasen commented Mar 10, 2020

When I try to use the ContentEditable component with Typescript 3.7.5 I get the following error:

No overload matches this call.
  Overload 1 of 2, '(props: Readonly<Props>): ContentEditable', gave the following error.
    Property 'onChange' is missing in type '{ innerRef: RefObject<HTMLSpanElement>; className: string; tagName: string; html: string; }' but required in type 'Pick<Readonly<Props> & Readonly<{ children?: ReactNode; }>, "ref" | "html" | "style" | "title" | "className" | "children" | "defaultChecked" | ... 251 more ... | "key">'.
  Overload 2 of 2, '(props: Props, context?: any): ContentEditable', gave the following error.
    Property 'onChange' is missing in type '{ innerRef: RefObject<HTMLSpanElement>; className: string; tagName: string; html: string; }' but required in type 'Pick<Readonly<Props> & Readonly<{ children?: ReactNode; }>, "ref" | "html" | "style" | "title" | "className" | "children" | "defaultChecked" | ... 251 more ... | "key">'.  TS2769

Whether I specify onChange doesn't seem to do anything, this seems to be an issue with the use of Modify and DivProps where TS is basically saying you can't add an onChange to a div or something, not sure

@f0rmat1k
Copy link

f0rmat1k commented Jul 2, 2020

I also have errors in typings:

onScroll?: ((event: React.UIEvent<HTMLDivElement, UIEvent>) => void) | undefined;
onScrollCapture?: ((event: React.UIEvent<HTMLDivElement, UIEvent>) => void) | undefined;

TS2707: Generic type 'UIEvent' requires between 0 and 1 type arguments.

UIEvent has such interface:

interface UIEvent<T = Element> extends SyntheticEvent<T, NativeUIEvent> {
        detail: number;
        view: AbstractView;
    }

@lovasoa lovasoa added the bug label Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants