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

127
Visualizações
BlockAdBlock is not instantiated with React

Demo.js

export const AdBlockDemo = (props) => {

function adBlockNotDetected() {
    alert('AdBlock is not enabled');
}

function adBlockDetected() {
    alert('AdBlock is enabled');
}

useEffect(()=>{
            
    if(typeof blockAdBlock === 'undefined') {
    adBlockDetected();
} else {
    blockAdBlock.onDetected(adBlockDetected);
    blockAdBlock.onNotDetected(adBlockNotDetected);
      
       

    },[]);

}

I have installed blockadblock (3.2.1) on my project. when I try to use the instance of BlockAdBlock which is instantiated automatically then the following error has occurred.

'BlockAdBlock' is not defined  no-undef

I tried to create an instance manually after adding scripts and the same error occurs again

<script>var blockAdBlock = false;</script> 
<script src="./blockadblock.js"></script>

var blockAdBlock = new BlockAdBlock({
    checkOnLoad: true,
    resetOnEnd: true
});
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