Skip to content

Commit

Permalink
Wrap root node with SSRProvider (#586)
Browse files Browse the repository at this point in the history
* Wrap root node with SSRProvider

* Add changeset
  • Loading branch information
camertron authored Jun 6, 2023
1 parent 7858306 commit 5f2f390
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-rings-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/gatsby-theme-doctocat': patch
---

Wrap root node with an SSRProvider
9 changes: 6 additions & 3 deletions theme/src/components/wrap-root-element.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {SSRProvider} from '@react-aria/ssr'
import {MDXProvider} from '@mdx-js/react'
import {ThemeProvider} from '@primer/react'
import Link from './link'
Expand Down Expand Up @@ -52,9 +53,11 @@ const components = {

function wrapRootElement({element}) {
return (
<MDXProvider components={components}>
<ThemeProvider>{element}</ThemeProvider>
</MDXProvider>
<SSRProvider>
<MDXProvider components={components}>
<ThemeProvider>{element}</ThemeProvider>
</MDXProvider>
</SSRProvider>
)
}

Expand Down

0 comments on commit 5f2f390

Please sign in to comment.