Skip to content

Commit

Permalink
fix: change reactrenderer component type definition (ueberdosis#2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesmurray authored Jan 3, 2022
1 parent 40f3c38 commit 840aa44
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ReactRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export interface ReactRendererOptions {
className?: string,
}

type ComponentType<R> =
| React.ComponentClass
| React.FunctionComponent
| React.ForwardRefExoticComponent<{ items: any[], command: any } & React.RefAttributes<R>>
type ComponentType<R, P> =
React.ComponentClass<P> |
React.FunctionComponent<P> |
React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<R>>;

export class ReactRenderer<R = unknown> {
export class ReactRenderer<R = unknown,P = unknown> {
id: string

editor: ExtendedEditor
Expand All @@ -44,7 +44,7 @@ export class ReactRenderer<R = unknown> {

ref: R | null = null

constructor(component: ComponentType<R>, {
constructor(component: ComponentType<R, P>, {
editor,
props = {},
as = 'div',
Expand Down

0 comments on commit 840aa44

Please sign in to comment.