Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/react/src/next-ssr-plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ declare const globalThis: {
__UPLOADTHING?: EndpointMetadata;
};

export function NextSSRPlugin(props: { routerConfig: EndpointMetadata }) {
export function NextSSRPlugin(props: {
routerConfig: EndpointMetadata;
nonce?: string;
}) {
const id = useId();

// Set routerConfig on server globalThis
Expand All @@ -22,7 +25,11 @@ export function NextSSRPlugin(props: { routerConfig: EndpointMetadata }) {
];

return (
<script key={id} dangerouslySetInnerHTML={{ __html: html.join("") }} />
<script
key={id}
nonce={props.nonce}
dangerouslySetInnerHTML={{ __html: html.join("") }}
/>
);
});

Expand Down
Loading