Skip to content

potential extraneous div surrounding #__next #822

@alexnewmannn

Description

@alexnewmannn

Hey guys, so I've just started using next.js on version 1 and decided to try out version 2 tonight so I could use some of the document stuff. I upgraded and noticed, before implementing a custom document, that there is an extra div now rendering around the #__next element.
Below are some images of the issue:
image
Before 1.x.x

image
After 2.x.x ^

It appears the line was added here https://github.com/zeit/next.js/blob/master/server/document.js#L73
whereas it used to be like
https://github.com/zeit/next.js/blob/43b0e6f51420325abf2aed1157a197392364b25d/lib/document.js#L16

So it looks like its because now its rendering as its own component, instead of being nested inside html, wondering if we could instead make the containing element the __next element, and put the following line (https://github.com/zeit/next.js/blob/master/server/document.js#L75) within the __next component?

Reason being, theres an extra div now that seems pointless, its creating further nests for CSS if you want to make body a flex container as you need to propagate down until __next to match the width/height dimensions of body plus it will give cleaner markup.

I'm up for hearing suggestions/discussions around this and would be willing to help fix this issue, in the mean time I will have a play around and see what i can come up with.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueEasy to fix issues, good for newcomers

    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