fix: change reactrenderer component type definition (#2327)

This commit is contained in:
Luke Murray
2022-01-03 08:28:31 -05:00
committed by GitHub
parent bca223fd2e
commit 64dfae8511

View File

@@ -24,12 +24,12 @@ export interface ReactRendererOptions {
className?: string, className?: string,
} }
type ComponentType<R> = type ComponentType<R, P> =
| React.ComponentClass React.ComponentClass<P> |
| React.FunctionComponent React.FunctionComponent<P> |
| React.ForwardRefExoticComponent<{ items: any[], command: any } & React.RefAttributes<R>> React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<R>>;
export class ReactRenderer<R = unknown> { export class ReactRenderer<R = unknown,P = unknown> {
id: string id: string
editor: ExtendedEditor editor: ExtendedEditor
@@ -44,7 +44,7 @@ export class ReactRenderer<R = unknown> {
ref: R | null = null ref: R | null = null
constructor(component: ComponentType<R>, { constructor(component: ComponentType<R, P>, {
editor, editor,
props = {}, props = {},
as = 'div', as = 'div',