skip to Main Content

Is it too late to read the page URL with Reactjs and Nextjs?

I would like to dynamically render a script in next.js depending on the page url. My code in page/app.tsx <Head> <script id="script" src="www.cookie.com" data-cbid={typeof window !== 'undefined' && window.location.href.includes('localhost') ? "XXXXXXXXX" : "YYYYYYYYYY"} data-blockingmode="auto" type="text/javascript" async> </script> <Head> However, my…

VIEW QUESTION
Back To Top
Search