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

142
Visualizações
How to call confetti only once
if (isApplied && moreCount === 0 && route !== cartUrl && bagCouponActive) {
    return (
      <StickyBottomFooter bottom={bottomPosition}>
        <Confetti fire />
        <FlexBox
          spacing="py24 m-py12"
          align="center"
          justify="center"
          position="row"
          fullWidth
          style={{
            background: 'var(--secondary-green)',
            height: isMobile ? '40px' : '56px',
          }}
        >
          <Text size="16_24" mobileSize="14" thickness="medium" color="white">
            Congrats! you’ve unlocked '{couponCode}' offer
          </Text>

I am using Confetti to show this but appears everytime in every refresh these need to be get call only once in the home page

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

0

If you mean only once and keep it through refreshes, you need to store somewhere information that your confetti fired, for example in localStorage/sessionStorage:

localStorage.set('fired',true)

and then just check if it was fired before

<Confetti fire={localStorage.get('fired')} />

If you want to reset this state on page refresh and keep it only though router changes and redirects, just keep this information in useState or Redux store

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