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

how can i use ckeditor5 with typescript in react? #253

Closed
abhig02 opened this issue Nov 14, 2018 · 17 comments
Closed

how can i use ckeditor5 with typescript in react? #253

abhig02 opened this issue Nov 14, 2018 · 17 comments
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). squad:platform Issue to be handled by the Platform team. type:docs type:feature

Comments

@abhig02
Copy link

abhig02 commented Nov 14, 2018

🆕 Feature request

💻 Version of CKEditor

CKEditor5

@xinglie
Copy link

xinglie commented Nov 14, 2018

https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/react.html

@ma2ciek
Copy link
Contributor

ma2ciek commented Nov 14, 2018

Hi, @abhig02.

What actually do you need?

@ma2ciek
Copy link
Contributor

ma2ciek commented Dec 10, 2018

Closing because of lack of activity and missing problem description.

@ma2ciek ma2ciek closed this as completed Dec 10, 2018
@intelliapps-io
Copy link

Looking for a declaration file for the npm module '@ckeditor/ckeditor5-react'.

@ma2ciek
Copy link
Contributor

ma2ciek commented Jan 7, 2019

Hi, @intelliapps-io!

We don't provide any TS declaration files for our packages yet. Maybe it will change in the future, you can subscribe to the ckeditor/ckeditor5#504 if you want to track this topic.

@arasrezaei
Copy link

Hello.

declare module '@ckeditor/ckeditor5-react' {
    import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
    import Event from '@ckeditor/ckeditor5-utils/src/eventinfo'
    import { EditorConfig } from '@ckeditor/ckeditor5-core/src/editor/editorconfig'
    import * as React from 'react';
    const CKEditor: React.FunctionComponent<{
        disabled?: boolean;
        editor: typeof ClassicEditor;
        data?: string;
        id?: string;
        config?: EditorConfig;
        onReady?: (editor: ClassicEditor) => void;
        onChange?: (event: Event, editor: ClassicEditor) => void;
        onBlur?: (event: Event, editor: ClassicEditor) => void;
        onFocus?: (event: Event, editor: ClassicEditor) => void;
        onError?: (event: Event, editor: ClassicEditor) => void;
    }>
    export { CKEditor };
}

make sure install base ckeditor types.

@ma2ciek ma2ciek reopened this Jul 27, 2021
@ma2ciek ma2ciek transferred this issue from ckeditor/ckeditor5 Jul 27, 2021
@ujjwalchadha8
Copy link

Hello @ma2ciek! I am looking for the types too and in my case for the balloon editor. This is blocking our further development with CKEditor. I see that this issue was recently reopened and triaged. When can we expect the types to be released?

@roydukkey
Copy link

@arasrezaei Do you know if @ckeditor/ckeditor5-react supports ref?

@arasrezaei
Copy link

arasrezaei commented Sep 11, 2021

@arasrezaei Do you know if @ckeditor/ckeditor5-react supports ref?
<CKEditor onReady={editor=> {CKRef.current = editor}} />

@NattieGit
Copy link

NattieGit commented Jul 18, 2022

This is still a requested and important feature for anyone wanting to use this package in a typescript project.

Is there any update on the implementation of typescript type declarations for this package?

In a post above, a user arasrezaei has already kindly provided most of, if not all of the information required for you to add a type declaration file.

The fact that this would be so simple to add boggles the mind that it's been a requested feature for so long and not implemented.

Are you open to pull requests to add a type declaration file, because if so, this could expedite the process greatly.

Thanks for your time :)

@ptmkenny
Copy link

ptmkenny commented Aug 3, 2022

@nyatalieee As noted in the linked thread above, CKEditor5 is being migrated to TypeScript: ckeditor/ckeditor5#11704

@andrelcb
Copy link

Olá.

declare module '@ckeditor/ckeditor5-react' {
    import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
    import Event from '@ckeditor/ckeditor5-utils/src/eventinfo'
    import { EditorConfig } from '@ckeditor/ckeditor5-core/src/editor/editorconfig'
    import * as React from 'react';
    const CKEditor: React.FunctionComponent<{
        disabled?: boolean;
        editor: typeof ClassicEditor;
        data?: string;
        id?: string;
        config?: EditorConfig;
        onReady?: (editor: ClassicEditor) => void;
        onChange?: (event: Event, editor: ClassicEditor) => void;
        onBlur?: (event: Event, editor: ClassicEditor) => void;
        onFocus?: (event: Event, editor: ClassicEditor) => void;
        onError?: (event: Event, editor: ClassicEditor) => void;
    }>
    export { CKEditor };
}

certifique-se de instalar os tipos básicos de ckeditor.

JSX element type 'CKEditor' has no construction or call signatures.

i get this error

@pomek
Copy link
Member

pomek commented Apr 21, 2023

Starting from version 6.0.0 (https://github.com/ckeditor/ckeditor5-react/releases/tag/v6.0.0), the CKEditor React component is migrated to TypeScript. The component publishes its declarations, so a TS compiler should not complain anymore.

@pomek pomek closed this as completed Apr 21, 2023
@pomek pomek added the resolution:resolved This issue was already resolved (e.g. by another ticket). label Apr 21, 2023
@frimmy
Copy link

frimmy commented May 1, 2023

was still getting this error after upgrading to v6 -- can this issue be re-opened?

@Witoso
Copy link
Member

Witoso commented May 4, 2023

@frimmy could you be a little bit more specific about which error you have in mind?

@frimmy
Copy link

frimmy commented May 4, 2023

Olá.

declare module '@ckeditor/ckeditor5-react' {
    import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
    import Event from '@ckeditor/ckeditor5-utils/src/eventinfo'
    import { EditorConfig } from '@ckeditor/ckeditor5-core/src/editor/editorconfig'
    import * as React from 'react';
    const CKEditor: React.FunctionComponent<{
        disabled?: boolean;
        editor: typeof ClassicEditor;
        data?: string;
        id?: string;
        config?: EditorConfig;
        onReady?: (editor: ClassicEditor) => void;
        onChange?: (event: Event, editor: ClassicEditor) => void;
        onBlur?: (event: Event, editor: ClassicEditor) => void;
        onFocus?: (event: Event, editor: ClassicEditor) => void;
        onError?: (event: Event, editor: ClassicEditor) => void;
    }>
    export { CKEditor };
}

certifique-se de instalar os tipos básicos de ckeditor.

JSX element type 'CKEditor' has no construction or call signatures.

i get this error

the same error reported by @andrelcb - JSX element type 'CKEditor' has no construction or call signatures

@Witoso
Copy link
Member

Witoso commented May 4, 2023

As CKEditor ships the typings you shouldn't do: declare module '@ckeditor/ckeditor5-react' if you use it with TypeScript. Those module augmentations are no longer needed. Check our demo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). squad:platform Issue to be handled by the Platform team. type:docs type:feature
Projects
None yet
Development

No branches or pull requests