Skip to content
Source
Sign inSign up
TanStack/router

fix: nonce support #5287

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5287/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 6 changed files with 21 additions and 6 deletions (loading 3).

x
0 of 6 viewed, 6 left
13 additions and 4 deletionspackages/react-router/src/Asset.tsxModified
View file
@@ -12,7 +12,8 @@
tag,
attrs,
children,
-}: RouterManagedTag): React.ReactElement | null {
+ nonce,
+}: RouterManagedTag & { nonce?: string }): React.ReactElement | null {
switch (tag) {
case 'title':
return (
@@ -23,16 +24,21 @@
case 'meta':
return <meta {...attrs} suppressHydrationWarning />
case 'link':
- return <link {...attrs} suppressHydrationWarning />
+ return <link {...attrs} nonce={nonce} suppressHydrationWarning />
case 'style':
return (
<style
{...attrs}
dangerouslySetInnerHTML={{ __html: children as string }}
+ nonce={nonce}
/>
case 'script':