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

264
Visualizações
Uncaught RangeError: Maximum call stack size exceeded can't figure out why

I'm getting a state variable (formData) as props from parent in this child component which I'm working on. I have an email input with onChange validation which also searches for the email in our database.I have a onFormFeildsChange which is a function in another file, is setting the fromData and validating it. Once the validation is done I'm hitting an API in the " getCandidateByEmail " function to know whether this email exist or not. But the code won't move past the await function. I also tried using then() but I get the same error. Please help understand the issue with my code.

const getCandidateByEmail = async () => {
console.log("in getCandidateByEmail before");

const response = await getCandidateByEmail({
  email: formDataProp?.formData?.email?.valueText,
});

}

The use Effect:-

useEffect(() => {
if (validationStatus?.emailValid) {
  console.log("in useffect email valid");
  getCandidateByEmail();
}

}, [formDataProp?.formData?.email?.valueText]);

The input JSX :-

<input
              defaultValue={formDataProp?.formData?.email?.valueText}
              type="email"                
              placeholder="Email of candidate"
              onChange={($event) => {
                onFormFeildsChange(
                  $event,
                  formDataProp?.formData,
                  formDataProp?.setFormData
                );

} />

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

My function and the API call inside that function both had the same name which was causing this infinte loop

about 4 years ago · Juan Pablo Isaza Relatório
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