Skip to content
Discussion options

You must be logged in to vote

Dá uma olhada aqui na documentação do styled-components: https://styled-components.com/docs/advanced#nextjs

Next.js
Basically you need to add a custom pages/_document.js (if you don't have one). Then copy the logic for styled-components to inject the server side rendered styles into the <head>.
Refer to our example in the Next.js repo for an up-to-date usage example.

Vc só precisa adicionar um arquivo em pages/_document.js com o código de exemplo para habilitar o server side rendering com o styled-components.

Link do arquivo de exemplo: https://github.com/vercel/next.js/blob/master/examples/with-styled-components/pages/_document.js

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@rhuangabrielsantos
Comment options

Comment options

You must be logged in to vote
1 reply
@rhuangabrielsantos
Comment options

Answer selected by rhuangabrielsantos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants