Skip to content

Commit

Permalink
Merge branch 'dev' into fix-import-svg-from-node-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori authored Aug 8, 2023
2 parents 7b51abe + 23f27ef commit f9bd868
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/olive-lemons-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Use unique key for `script:ld+json` meta descriptors
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@
- vorcigernix
- wangbinyq
- weavdale
- wilcoschoneveld
- willhack
- willin
- wizardlyhel
Expand Down
19 changes: 8 additions & 11 deletions packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -606,21 +606,18 @@ export function Meta() {
}

if ("script:ld+json" in metaProps) {
let json: string | null = null;
try {
json = JSON.stringify(metaProps["script:ld+json"]);
} catch (err) {}
return (
json != null && (
let json = JSON.stringify(metaProps["script:ld+json"]);
return (
<script
key="script:ld+json"
key={`script:ld+json:${json}`}
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(metaProps["script:ld+json"]),
}}
dangerouslySetInnerHTML={{ __html: json }}
/>
)
);
);
} catch (err) {
return null;
}
}
return <meta key={JSON.stringify(metaProps)} {...metaProps} />;
})}
Expand Down

0 comments on commit f9bd868

Please sign in to comment.