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

170
Visualizações
await/async firebase with react native

Im trying to display console.log('here1') and enter in the if condition when I finished to check number of children. For now, I have the output :

  • here1 false
  • here2 true
  • here1 true
    toggleisModal = async () => {
        const task = this.props.task;
        await firebase.database().ref("Tasks").on("child_added", async (snapshot2) => {
        if (snapshot2.exists()) {
            const countChild = await 
                firebase.database().ref("Tasks").child(snapshot2.key).child(task.taskname);
                countChild.on("value", (snapshot3) => {
                if (snapshot3.numChildren() >= 6) {
                    this.setState({ checkExist: true })
                    console.log("here2 ", this.state.checkExist)
                   }
                })
         }
    })
    console.log("here1 ", this.state.checkExist);


    if (this.state.checkExist === true) {
      this.setState({ showTaskVisible: false });
    }
    else {
      this.setState({ showTaskVisible: !this.state.showTaskVisible });
    }
  };
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