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

151
Visualizações
settimeout to show progressbar for 500ms

props.loadingStatus.state ( value coming from server) (value can be Not Started, Running, Completed) depending on the value of loadingstatus i.e. if running then show progressbar + if state == completed quicker than 500ms then make progressbar visible for 500ms.

current result: I am able to see the loadingbar but then even after 500ms its visible. I am not sure where my logic going wrong.

const App =() => {
    const [LoadStat, setLoadStat] = React.useState(props.loadingStatus.state);
    React.useEffect(() => {
        setTimeout(() => {
          if (LoadStat === Running) {
            setLoadStat(props.loadingStatus.state);
          }
        }, 500);
    }, []);

    return (
    <>
        {LoadStat && (
          <ProgressBar
           minValue={0}
           maxValue={100}
           progress={percentage}
           />
        )}
    </>
    );
  }
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

React.useEffect(() => {
    if (LoadStat === Running) {
        setLoadStat(props.loadingStatus.state);
    }
    else{   
        setTimeout(() => {
            // hide the progressBar
        }, 500);
    }
}, []);

I don't know if this answers your question but here is what i got from your request. With this the progressBar will be updated on every loadStatus change but will disapear 500ms after terminated.

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