Skip to content

Commit

Permalink
[backend] refact
Browse files Browse the repository at this point in the history
  • Loading branch information
savacano28 committed Jun 5, 2024
1 parent e6bffc8 commit f99deb0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { useForm, FormProvider, SubmitHandler } from 'react-hook-form';
import { Button } from '@mui/material';
import MarkDownField from '../../../../components/fields/MarkDownField';
Expand Down Expand Up @@ -28,8 +28,13 @@ const PolicyForm: React.FC<Props> = ({
const {
handleSubmit,
formState: { isDirty, isSubmitting },
reset,
} = methods;

useEffect(() => {
reset(initialValues);
}, [initialValues, reset]);

return (
<FormProvider {...methods}>
<form id="policyForm" onSubmit={handleSubmit(onSubmit)}>
Expand Down

0 comments on commit f99deb0

Please sign in to comment.