Next.js Discord

Discord Forum

How to pass nonce to <NextScript /> + layout.tsx

Unanswered
West African Lion posted this in #help-forum
Open in Discord
Avatar
West African LionOP
In Remix [it is possible to pass a nonce to the runtime/bundled scripts](https://remix.run/docs/en/main/components/scripts#props). How does one do it in nextjs?

All the guides appear to only be for attaching to external scripts.

2 Replies

Avatar
West African LionOP
There appears there used to be a <NextScript /> component that you could pass a nonce to but this appears to have been deprecated for layout.tsx in later version
Avatar
Chinese Alligator
also searching for the solution to this