1

I would like to implement a script within my next.js app I'm currently using

import Script from "next/script";

and then within my

return (
<div>
<Script>const tooltips= {color: true, icon: true, size: true}</Script>
<Script src="url to script"></Script>
<main>
</main>
</div>
)

the script loads, but how can i set the tooltips const in nextjs? using

const something = ""

doesn't work. I tried using the script within a normal html file and it works. How would i implement this in nextjs? I'm probably already implementing it wrong because i cant use const after my return? What would be the right way to set these values?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.