Skip to content

Commit

Permalink
simplify JSON.stringify (pacocoursey#265)
Browse files Browse the repository at this point in the history
* Update index.tsx

* Update index.tsx

---------

Co-authored-by: paco <34928425+pacocoursey@users.noreply.github.com>
  • Loading branch information
Dimitri POSTOLOV and pacocoursey authored Mar 13, 2024
1 parent 19e5225 commit 9d05205
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions next-themes/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ const ThemeScript = React.memo(
suppressHydrationWarning
nonce={typeof window === 'undefined' ? nonce : ''}
dangerouslySetInnerHTML={{
__html: `(${script.toString()})(${scriptProps
.map(p => JSON.stringify(p || null))
.join(',')})`
__html: `(${script.toString()})(${JSON.stringify(scriptProps).slice(1, -1)})`
}}
/>
)
Expand Down

0 comments on commit 9d05205

Please sign in to comment.