aruniverse / adblock-detect-react

Provides utilities to check if ad block is enabled on a page via either a React hook or a wrapper component.
https://www.npmjs.com/package/adblock-detect-react
MIT License
64 stars 10 forks source link

Offer a way to re-check when browser path change #18

Closed icastillejogomez closed 2 years ago

icastillejogomez commented 2 years ago

Pass config object to hook to re-check when browser urls changes.

When I make a route change with next-router system and the destination path is not in the adblock whitelist this module does not catch it

aruniverse commented 2 years ago

Hi, I'm not sure if I follow. Could you possibly create a sample on CodeSandbox or StackBlitz demonstrating the issue? There is no "whitelist" with this module. Shouldn't be too hard to add what you've asked, just want to make sure I understand the "issue".

domis4 commented 2 years ago

@icastillejogomez i use it with nextjs with no problem. Make sure it is part of your route component, not the global one. If its you global one you would add to need the key property like:

key={router.asPath}

aruniverse commented 2 years ago

Closing this issue since it's been over a month since the last update from @icastillejogomez and @domis4 has provided a workaround solution. If this still appears to be an actual issue, we can reopen it; but please provide a reproducible sample.