Skip to content
Discussion options

You must be logged in to vote

Hi,

The problem is the _document can't contain any interactivity.

From, https://nextjs.org/docs/pages/building-your-application/routing/custom-document:

_document is only rendered on the server, so event handlers like onClick cannot be used in this file.

I'd say, break it down, into the Component that injects the Scripts you need, used in _document, and the component that handles consent, in _app

What errors are you seeing?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Elindo586
Comment options

Answer selected by Elindo586
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants