Skip to content

Commit

Permalink
Allow nonce value to be passed to ExternalScripts component
Browse files Browse the repository at this point in the history
  • Loading branch information
mnemitz committed Jan 24, 2025
1 parent d605dd8 commit 1377f09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/react/external-scripts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ export interface ExternalScriptsHandle<Data = unknown> {
* // Then render ExternalScripts in your root
* return <ExternalScripts />
*/
export function ExternalScripts() {
export function ExternalScripts({ nonce }: { nonce?: string }) {
let scripts = useExternalScripts();

return (
<>
{scripts.map((props) => {
return <ExternalScript key={props.src} {...props} />;
return <ExternalScript key={props.src} {...props} nonce={nonce} />;
})}
</>
);
Expand Down

0 comments on commit 1377f09

Please sign in to comment.