fix: change reactrenderer component type definition (#2327)
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user