Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
Re execute a hook every time i press on a button

Hey i have a hook function witch useEffect who at the end return me some data i call the hooks on a page call "Deals" and the hook is returning me all the deals.

var CRMData = GetData("Deals", userEmail, userID);

But the thing is the hook is called at the begining of the page so when i modify one deals the hook is supposed to re execute itself so that i can see the deals modified

Every time i press on my button modify i want to re execute my hook GetData

const updateDeals = () => { axios .put(baseUrl + "module/Deals/" + CRMData.rows[indexDeal].id, { values }) .then((response) => { CRMData = GetData("Deals", userEmail, userID)}) .catch((err) => { console.log(err); }); };

But when i put it on a UseEffect i have the error U are breaking the rules of hook

When i put it on my update response same error so i'm a little bit stuck here sorry i dont' have a lot of code to share or it will be too long.

I'm a bit stuck on this one if you are able to help me it's with pleasure

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!