Next.js Discord

Discord Forum

Does the <Script> component accept attributes/props other than the ones listed in the docs?

Answered
Spectacled bear posted this in #help-forum
Open in Discord
Spectacled bearOP
In next-goatcounter there's this code
return (
        <Script
            data-goatcounter={siteUrl}
            src={scriptSrc ?? "//gc.zgo.at/count.js"}
            strategy="afterInteractive"
        />
    );


Does that code really work? I also wonder if I can add another attribute from goatcounter like data-goatcounter-settings
Answered by joulev
aside from documented props, <Script> accepts any props that <script> also accepts
View full answer

2 Replies