Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const SubmissionFormContainer: React.FC = () => {
const { mutate, error, status, reset } = useMutation(submitFormAction);
const handleSubmit = async (values: SubmissionValues, actions: FormikActions) => {
reset();
try {
await mutate(values);
actions.resetForm();
} catch {
throw new Error('An unexpected error occurred');
} finally {
actions.setSubmitting(false);
}
};
return (
{error && (