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