how to implement styled component to kendo-react-editor, using node v18

0 Answers 210 Views
Editor Styling
rex
Top achievements
Rank 1
rex asked on 08 Sep 2023, 03:27 AM

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;
  }
`;

Filip
Telerik team
commented on 11 Sep 2023, 03:19 PM

Hi, Rex,

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
rex
Top achievements
Rank 1
commented on 15 Sep 2023, 01:59 AM

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.

 


Types of parameters 'selection' and 'selection' are incompatible. 


Type 'import("/source/app-index/node_modules/@progress/kendo-editor-common/node_modules/prosemirror-view/node_modules/prosemirror-state/dist/index").Selection' 


is not assignable to 


type 'import("/source/app-index/node_modules/@progress/kendo-editor-common/node_modules/prosemirror-state/dist/index").Selection'.

Filip
Telerik team
commented on 18 Sep 2023, 05:05 PM

Hi, rex,

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

No answers yet. Maybe you can help?

Tags
Editor Styling
Asked by
rex
Top achievements
Rank 1
Share this question
or