I recently upgraded my node version from 14 -> 18.
After the upgrade, i started getting incompatible props datatype errors like the one below.
Can you please help me on how to fix this issue? I've spent so much time debugging this. I'd appreciate any help. Thanks in advance!
Error
TS2769: No overload matches this call.
Overload 1 of 2, '(component: AnyStyledComponent): ThemedStyledFunction<any, any, any, any>', gave the following error.
Argument of type 'typeof Editor' is not assignable to parameter of type 'AnyStyledComponent'.
Type 'typeof Editor' is not assignable to type 'StyledComponent<any, any, any, never>'.
Type 'typeof Editor' is not assignable to type 'string'.
Overload 2 of 2, '(component: keyof IntrinsicElements | ComponentType<any>): ThemedStyledFunction<keyof IntrinsicElements | ComponentType<any>, any, {}, never>', gave the following error.
Argument of type 'typeof Editor' is not assignable to parameter of type 'keyof IntrinsicElements | ComponentType<any>'.
Type 'typeof Editor' is not assignable to type 'ComponentClass<any, any>'.
Types of property 'contextType' are incompatible.
Type 'React.Context<any> | undefined' is not assignable to type 'import("/source/app/node_modules/@types/react-dom/node_modules/@types/react/ts5.0/index").Context<any> | undefined'.
Code
import { Editor } from '@progress/kendo-react-editor';
import styled from 'styled-components';
export const EditorContainer = styled(Editor)`
&.k-editor {
border: none;
background-color: inherit;
}
&.k-editor > .k-toolbar {
border: none;
padding-left: 0px;
}
`;
I created a sample app with Node version 18.0.0 with the provided code, however, I was not able to reproduce the error. I can recommend upgrading to the latest version of the components which is 5.17.0 as that might resolve it.
In case this does not help, since it will be hard to pinpoint what is causing this error without a sample, can you please provide a runnable example that reproduces this behavior so that I can debug it locally and see what is causing it?
Regards,
Filip
I did this but it didn't work. I did a simple check on interfaces used and here's i got, the editor is referring to 2 different interfaces and it looks like it's the version for the sources are not the same.
I can recommend making sure that the versions match, in case you are still struggling with the error, can you isolate the issue in a runnable example so that we can debug it locally and advise further?
Regards, Filip