diff --git a/src/ui/fields/editable.tsx b/src/ui/fields/editable.tsx index d9b0e989..5402bd9f 100644 --- a/src/ui/fields/editable.tsx +++ b/src/ui/fields/editable.tsx @@ -1,7 +1,7 @@ /** * @module ui */ -import { Fragment, FunctionComponent, VNode } from "preact"; +import { ComponentType, Fragment, VNode } from "preact"; import { Dispatch, Reducer, useContext, useEffect, useMemo, useRef } from "preact/hooks"; import { ChangeEvent, useReducer } from "preact/compat"; import Select, { ActionMeta } from "react-select"; @@ -50,8 +50,8 @@ export interface EditableProps { } type EditableElementProps = EditableState & P; -export type EditableElement = FunctionComponent & P>; - +export type EditableElement = ComponentType & P>; + /** * Actions which update/change the state of an editable. * @@ -136,14 +136,14 @@ export function ControlledEditable({ editor: Editor, onUpdate, content, - props, - sourcePath + props, + sourcePath, }: Omit, "dispatch" | "state" | "editor"> & { onUpdate: (v: T) => unknown; content: T; editor: EditableElement; - props: P; - sourcePath: string; + props: P; + sourcePath: string; }) { const [state, dispatch] = useEditableDispatch(() => ({ updater: onUpdate,