Duplicated SSR styles in _document
See original GitHub issueThis can be checked by doing a quick search in the source code of https://primer.style/components for <style id="emotion-static">
or <style data-styled-components="jxlxdj dvAJpH kOFOVP eGjeoI dqzKnc fGWUSs">
It might be due to returning styles
props for SSR styles.
we don’t really need to render them in the <Head>
as this is causing the duplication.
This could be fixed by either removing {styles}
in the in the <Head>
o renaming the props to other term, such as styleTags
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
SSR duplicates stylesheets on refresh · Issue #1890 - GitHub
What we've found is that sheet.collectStyles will append a duplicate set of styles on subsequent calls. I've attached a screenshot of what ...
Read more >Styled Components with SSR duplicating CSS code in JS files
I have a custom server with a HoC that wraps styled in a monorepo. withstyles.js import styled from 'styled-components'; export default ...
Read more >SSR + CSS Class Names Duplicated? - The Berryware Blog
I first started with NextJS and tried to get Styled Components working with it and Storybook. After running into too many problems I...
Read more >SSRS template to use with “Copy Report Style” to duplicate ...
I have used >Epicor10 >Report Style Maintenance >Actions >Copy Report Style to make a new formatted ARForm (invoice) report in SSRS Report ...
Read more >Duplicating Styles without Dependency - Microsoft Word Tips
I found a simpler solution that foregoes the Organizer. 1. Create the two styles in the original document. 2. Copy some text with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @matallo thanks for pointing this out, it was actually on my list of things to check out this week 🙈 I tried your suggestion and it worked! It looks like the official documentation also suggests using something other than
styles
for the name as well.I might not have explained myself well: in both cases the CSS is rendered statically but when passing the style tags with the
styles
props name they get repeated (search for occurrences of the strings above in the source code of the page).