Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda