Skip to content

styled-components example doesn't server render well #1381

@sergiodxa

Description

@sergiodxa

I tried the styled-components example and in the server render process it writes the styles directly in the HTML instead of rendering them inside a <style> tag.

Example with JS disabled
screen shot 2017-03-09 at 22 58 19

Example with JS enabled
screen shot 2017-03-09 at 22 59 27

This is due this line (https://github.com/zeit/next.js/blob/master/examples/with-styled-components/pages/_document.js#L7) return an string without the <style> tag and Next.js expect the style prop to have the tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions