ckeditor/ckeditor5-react

Custom Installation setup via Online builder integrations with next-js does not work types in relation to 'create' property missing in '{ Editor: typeof Editor; EditorWatchdog: typeof EditorWatchdog; }', assistance needed!

jasmeet2021 opened this issue · 3 comments

Errors:

editor={Editor}

Property 'create' is missing in type '{ Editor: typeof Editor; EditorWatchdog: typeof EditorWatchdog; }' but required in type '{ create(...args: any): Promise; }'

const data = editor.getData();

Property 'getData' does not exist on type 'Editor'.

Code:

'use client';

import React from 'react';
import { CKEditor } from "@ckeditor/ckeditor5-react";
import Editor from "ckeditor5-custom-build";

const editorConfiguration = {
    toolbar: [
        'heading',
        '|',
        'bold',
        'italic',
        'link',
        'bulletedList',
        'numberedList',
        '|',
        'outdent',
        'indent',
        '|',
        'imageUpload',
        'blockQuote',
        'insertTable',
        'mediaEmbed',
        'undo',
        'redo'
    ]
};

function CustomEditor( props: any ) {
        return (
            <CKEditor
                editor={ Editor }
                config={ editorConfiguration }
                data={ props.initialData }
                onChange={ (event, editor ) => {
                    const data = editor.getData();
                    console.log( { event, editor, data } );
                } }
            />
        )
}

export default CustomEditor;

dependencies:

"@ckeditor/ckeditor5-react": "^6.2.0",
"ckeditor5-custom-build": "file:ckeditor5-40.1.0-6j2qd56wfdru",