Separate Client Portal & Dashboard
This commit is contained in:
19
frontend/dashboard/src/components/hook-form/FormProvider.tsx
Normal file
19
frontend/dashboard/src/components/hook-form/FormProvider.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ReactNode } from 'react';
|
||||
// form
|
||||
import { FormProvider as Form, UseFormReturn } from 'react-hook-form';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
type Props = {
|
||||
children: ReactNode;
|
||||
methods: UseFormReturn<any>;
|
||||
onSubmit?: VoidFunction;
|
||||
};
|
||||
|
||||
export default function FormProvider({ children, onSubmit, methods }: Props) {
|
||||
return (
|
||||
<Form {...methods}>
|
||||
<form onSubmit={onSubmit}>{children}</form>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user