From c801e791775851b5f60a73007f466af9bc5bcff1 Mon Sep 17 00:00:00 2001 From: Hubert Koster Date: Wed, 19 Jul 2023 16:52:24 +0200 Subject: [PATCH] chore: adding reset to the form --- src/features/dashboard/components/AppForm/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/features/dashboard/components/AppForm/index.tsx b/src/features/dashboard/components/AppForm/index.tsx index aa520a65..2fd8a5ca 100644 --- a/src/features/dashboard/components/AppForm/index.tsx +++ b/src/features/dashboard/components/AppForm/index.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, useMemo } from 'react'; +import React, { ReactNode, useCallback, useMemo } from 'react'; import { Text } from '@deriv/ui'; import { useForm } from 'react-hook-form'; import { isNotDemoCurrency } from '@site/src/utils'; @@ -33,6 +33,7 @@ const AppForm = ({ register, handleSubmit, formState: { errors }, + reset, } = useForm({ mode: 'onBlur', resolver: yupResolver(is_update_mode ? appEditSchema : appRegisterSchema), @@ -53,6 +54,11 @@ const AppForm = ({ return admin_check_array.includes(true); }; + const submitAndReset = (e) => { + submit(e); + reset(); + }; + const disableMarkup = useMemo(() => { let isDisabled; isNotDemoCurrency(currentLoginAccount) === 'Demo' ? (isDisabled = true) : (isDisabled = false); @@ -71,7 +77,7 @@ const AppForm = ({ return ( -
+
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy