A simple React hook for detecting the use of an Ad Blocker by the user

useDetectAdBlocker

? A simple React hook for detecting the use of an Ad Blocker by the user.

Built with TypeScript (built-in type safety and support).

Installation

npm i use-detect-ad-blocker
# or
yarn add use-detect-ad-blocker

Usage

The following is an example of how you might choose to use this hook:

import { useDetectAdBlocker } from "use-detect-ad-blocker";

const Component = () => {
    const detect = useDetectAdBlocker();

    return {detect ? <Modal /> : <HomePage />}
}

Created and maintained with ❤️ by @FilippoFonseca.

GitHub

View Github