How can I render custom react component as a plugin in the ckeditor5 toolbar?

69 Views Asked by At

I am trying to create custom ckeditor5 plugin in react js, I want to display my own react component in ckeditor5 toolbar.

class Video extends Plugin {
   init() {
      const editor = this.editor

      editor.ui.componentFactory.add('video', VideoButton)
   }
}
export function VideoButton() {
   return (
      <>
         <MyOwnComponent />
      </>
   )
}

I want to render my own component into the ckeditor5 toolbar. But it is giving me the below error :

Argument of type '() => Element' is not assignable to parameter of type '(locale: Locale) => View<HTMLElement>'.
  Type 'ReactElement<any, any>' is missing the following properties from type 'View<HTMLElement>': element, isRendered, locale, t, and 22 more.

How can I render custom react component as a plugin in the ckeditor5 toolbar?

0

There are 0 best solutions below