-
Notifications
You must be signed in to change notification settings - Fork 27.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With-Aphrodite example renders styles twice in the <head> #1853
Comments
If you change inside import Document, { Head, Main, NextScript } from 'next/document'
import { StyleSheetServer } from 'aphrodite'
export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) {
const { html, css } = StyleSheetServer.renderStatic(() => renderPage())
return { ...html, css }
}
render () {
return (
<html>
<Head>
<title>My page</title>
<style dangerouslySetInnerHTML={{ __html: this.props.css.content }} data-aphrodite="" />
</Head>
<body>
<Main />
<NextScript />
</body>
</html>
)
}
} But it's going to put the same class two times inside the style tag.
|
We found the solution in #next. Waiting for the PR. |
This PR solves our issue: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've been looking at Aphrodite - downloaded the example and started up the dev. I noticed that in the head tag the styles are getting added twice.
This is what shows up from the example:
Any ideas why the duplicate?
The text was updated successfully, but these errors were encountered: