Skip to content

Commit

Permalink
fix: adjust ssr styled components
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielduete committed Nov 3, 2023
1 parent c29ed93 commit 02bc692
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pages/_app.page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { AppProps } from 'next/app'
import Head from 'next/head'
import TextsStyle from '~/src/styles/TextsStyle'

import GlobalStyle from '../src/styles/GlobalStyle'
import TextsStyle from '../src/styles/TextsStyle'

function MyApp({ Component, pageProps }: AppProps) {
return (
Expand Down
8 changes: 6 additions & 2 deletions pages/_document.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ export default class MyDocument extends Document {
})

const initialProps = await Document.getInitialProps(ctx)

return {
...initialProps,
styles: [initialProps.styles, sheet.getStyleElement()],
styles: (
<>
{initialProps.styles}
{sheet.getStyleElement()}
</>
),
}
} finally {
sheet.seal()
Expand Down

0 comments on commit 02bc692

Please sign in to comment.