-
In a Nextjs application, what would be the implication of just adding cookieconsent in a script tag in Header.js?
|
Beta Was this translation helpful? Give feedback.
Answered by
orestbida
Apr 20, 2022
Replies: 1 comment
-
In this case you'd make 2 or 3 additional requests (if we also count the stylesheet) which could have been avoided. Using a react component allows you to bundle the scripts + stylesheet and save unnecessary HTTP requests. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jkohlin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this case you'd make 2 or 3 additional requests (if we also count the stylesheet) which could have been avoided.
You'd also have to add the
defer
attribute to make sure that the<body>
element actually exists.Using a react component allows you to bundle the scripts + stylesheet and save unnecessary HTTP requests.