Skip to content

Commit

Permalink
chore: types change for form functions
Browse files Browse the repository at this point in the history
  • Loading branch information
DNR500 committed Sep 17, 2024
1 parent ded1750 commit 31f6e24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { WidgetViewContainer } from './WidgetViewContainer';
export function WidgetView() {
const { config } = useConfig();
const drawerRef = useRef<WidgetDrawer>(null);
const formRef = useRef<FormFunctions>();
const formRef = useRef<FormFunctions | undefined>();
const { isSkeletonShown, isSkeletonSideBySide } = useSkeletonToolValues();
const { formValues } = useFormValues();

Expand Down
10 changes: 4 additions & 6 deletions packages/widget/src/types/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,11 @@ export type SetFieldValueFunction = <K extends FieldNames>(
options?: FormFieldOptions,
) => void;

export type FormFunctions =
| {
setFieldValue: SetFieldValueFunction;
}
| undefined;
export type FormFunctions = {
setFieldValue: SetFieldValueFunction;
};

export type FormRef = MutableRefObject<FormFunctions>;
export type FormRef = MutableRefObject<FormFunctions | undefined>;

export interface FormRefProps {
formRef?: FormRef;
Expand Down

0 comments on commit 31f6e24

Please sign in to comment.