I made a hook useSendFormData , when i use it i get Invalid hook call.
Hook takes
-
data from SubmitForm
-
url:string,
-
method: post or put
-
success:
succes message if it was success -
id: not required but if item has id
i is added to api call.export const useSendFormData = async ({ formData, url, method, success, id, }) => { const [data, setData] = useState({ error: "", loading: true, success: "", data: [], }); const setPartData = (partialData) => setData({ ...data, ...partialData }); try { if (method === "post") { const { data } = await axios.post( `${SERVER_API}api/v1/${url}/${id ?? ""}`, formData ); setPartData({ data, success, error: null }); } else if (method === "put") { const { data } = await axios.post( `${SERVER_API}api/v1/${url}/${id ?? ""}`, formData ); setPartData({ data, success, error: null }); } setPartData({ loading: false, }); } catch (err) { const { data } = err.response; setPartData({ error: data.error, success: null, loading: false, }); } return { data, }; };
I call it inside Submit Form ,i dont know this matter but i use for handling forms react-hook-forms
const sendFormData = useSendFormData const handleForm = async (info) => { const { data } = await sendFormData({ formData: info, url: "auth/forgot-password", method: "post", success: "A password reset message has been sent to your email", }); console.log(data); reset(); };
If i change
const sendFormData = useSendFormData
to
const sendFormData = useSendFormData()
I get Cannot destructure property ‘formData’ of ‘undefined’ as it is undefined..How can i make this work and if you see any way of improving this coustom hook I would be very grateful for your help and time.
https://kamagraday.com/ kamagra
http://vardenafilz.com levitra 5 mg
accutane in india price – generic of accutane buy accutane online usa
buy amoxicilin online – buy amoxicillin 500 amoxil
generic vardenafil usa – vardenafil 20 mg online where to buy vardenafil in canada
http://himscanada.com/ generic cialis online canada
http://doctorkiva.com viagra connect
tadalafil 20mg india price – cialis 5mg daily cost cialis 10mg india
stromectol cream – ivermectin order online ivermectin uk
cheap accutane – accutpharm.com how to get accutane without prescription
http://zithrozpack.com azithromycin
lyrica 20 mg – generic lyrica medication canada drugs direct
buy amoxicillin 500 mg online mexico – amoxil amoxil 500
oral ivermectin cost – ivermectin pills ivermectin cost
prednisone australia – prednisone tablets india fast shipping prednisone
http://stromectolhumans.com/ stromectol for humans
order provigil – modapls.com modafinil online
https://viagraxyu.com sildenafil citrate tablets 100 mg
zithromax without a script – generic zithromax 500mg buy azithromycin 100mg online
senior women for sex
free online dating sites with no fees
http://ivermectineffects.com/ ivermectin tablets amazon
http://ivermectinovercounter.com/ ivermectin cream walmart
dating websites for gay guys
gay dating alberta
serious gay dating websites
https://ivermectineffects.com stromectol 3 mg tablets price
gay dating on minecraft
free gay dating live chicago
gay dating problems
https://ivermectinus.com/ ivermectin for humans
gay hiv interracial dating
daddy gay son dating sites
gay surfer dating
gnc ed pills – ed meds online without doctor prescription best ed drugs
levitra 10 mg tablets https://levitrair.com levitra or viagra
indian gay dating
gay dating it free
discreet married gay dating
buy ivermectin 6mg http://stromectolus.com ivermectin for humans dosage
https://albuterolotc.com/ albuterol sulfate patient assistance program
united health way norton healthcare mychart
ivermectin pills for humans https://ivermectinhome.com
gay dating j
gay dating transexual
gay bear site dating
stromectol https://stromectolus.com stromectol
stromectol over the counter walgreens pharmacy http://ivermcov.com/# ivermectin tablets
javascript-help.li recommended order prescription drugs online without doctor http://pharmvolk.com best canadian mail order pharmacies
description of a physician https://ventolinhfaer.com/ albuterol inhaler
ventolin inhaler – buy ventolin albuterol sulfate inhaler
cytotec pills buy – cytotec 200mcg buy cytotec online cheap
how to buy doxycycline without a prescription – can i purchase doxycycline over the counter where to buy doxycycline 100mg
neurontin brand coupon – 800mg neurontin synthroid purchase
how do you spell health department in spanish ivermectin 12 mg tablets for sale http://iveramectin.com generic ivermectin
where to purchase female viagra – buy viagra online pharmacy
arthritis in dogs and treatment https://dapoxetineus.com/ buy priligy online
pharmacy drugs – tadalafil 5mg tablets in india cialis 5mg price australia
generic levitra – buy online vardenafil in usa buy cheap vardenafil no prescription
stromectol tablets uk – ivermectin nz ivermectin for covid 19
apo-prednisone – 30mg prednisone over the counter prednisone canada
viagra generic name http://viagrob.com buy viagra cheaper
how to get accutane without prescription – where can i get accutane prescription generic accutane price
gay dwarf dating site
gay sex dating, hurricane utah
best european gay dating sit
amoxil USA – amoxicillin without dr script amoxicillin for sale in usa without px
javascript-help.li with ivermektin tabletter storbritannien http://ivermectinhum.com stromectol
order methylprednisolone online – methylprednisolone 16 mg lyrica price in india
gay dating interracial
gay dating hereford az jesse
slang gay dating
buy custom research papers – customized essay custom research paper writing
javascript-help.li reviewed stromectol over the counter walgreens pharmacy http://stromectl.com where to buy ivermectin for humans
ivermectina in vendita stromectol for sale https://stromectl.com ivermectin 3 mg tabletdosis
ivermectin 2% – buy stromectol pills stromectol 6 mg tablet
walmart drug prices lookup http://otcmailmeds.com drugs without a doctor’s prescription india React: Invalid hook call in SubmitForm, custom hook useSendFormData – JavaScript Help
buy prednisone 40mg – prednisone 5 tablets price for 15 prednisone
ventolin uk price – topventoli.com ventolin inhaler
where can i buy cytotec over the counter – buy cytotec online australia cytotec sale singapore
doxycycline 50 mg coupon – prednisolone tablets in india prednisolone cost tablets
azithromycin over counter walmart http://azithrozpack.com azithromycin 3 vs 5 days
ivermectin lotion for scabies – ivermectin cost canada ivermectin cream cost
ivermectin coronavirus – ivermectin 10 mg stromectol 12 mg
http://stromectolo.com – ivermectin for humans amazon
best place to buy tadalafil online reviews – tadalapills.com tadalafil buy online
where to get accutane without prescription – accutane coupon accutane medicine price
essay buy online – academic writing is college essay service
viagra for women uk – Cialis now price cialis 20 mg
cipla generic vardenafil – canada drug pharmacy over the counter ed pills that work
buy vardenafil line – vardenafil cost erectile dysfunction natural treatment
hydroxychloroquine buy online – hydroxychloroquine and zinc order prednisone 20mg online
http://stromectolforte.com/ cena stromectolu
cenforce 120mg online – vidalista 60mg kamagra gold 100 usa and uk
orlistat mice – orlistat medication reviews orlistat mayo
ivermectin 2% – stromectol cost in usa ivermectin price usa
ivermectin for humans amazon https://stromectolforte.com/ ivermectin 1% kem chung stromectol canada
viagra 10 mg – vigrxps sildenafil tablets 100 mg
how to heal heart disease http://quicken4loans.com – cash store loans
tadalafil prices 5mg – internet cialis tadalafil 5mg tablets india
alabama homework help
resume writing services cost
prednisone 20mg price – buy prednisone online 200 mg prednisone
ivermectin lice – stromectol lotion cost ivermectin 1mg
help writing an essay
college admission assistance
sildenafil 10 mg – viagra online prescription free cheap sildenafil citrate tablets
viagra online drugstore – levitra or viagra can i buy genuine viagra online
india pharmacy online tadalafil – cialis price walmart generic tadalafil canadian
buy ivermectin for humans – ivermectin australia buy ivermectin 3mg for humans
how much does viagra cost http://viagwdp.com/# how much is viagra female viagra usa
buy prednisone online without a prescription – prednisone 20mg prednisone drug costs
writing a good college essay
mba essay writing service
writing a descriptive essay
discursive essay
essay writing online
what’s a narrative essay
alcohol and amoxicillin hip prosthesis prophylaxis amoxil dose what class is amoxil and azithromycin
viagra pranks is viagra covered by medicaid viagra long term side effects when does levitra patent expire in australia
sildenafil generique pas cher – cialis en ligne cialis 40mg pas cher
buy stromectol usa – cialis 5mg generika ivermectin lotion cost
where to buy tadalafil on line tadalafil blood pressure
tadalafil cost walmart tadalafil brands
order accutane 40mg generic – buy generic amoxicillin 250mg amoxicillin oral
lyrica without prescription – order generic furosemide buy azithromycin without prescription
https://cialiswbtc.com/ where to order tadalafil tablets
zanaflex ca – cheap tizanidine 2mg oral gloperba
inderal us – generic trazodone 100mg order hydroxychloroquine generic
https://cialismat.com/ buy cialis pills
generic tadalafil from uk https://cialisvet.com/