Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda