Skip to content

can ReactDOM.render render to body without warning #16902

@whensea

Description

@whensea

Do you want to request a feature or report a bug?
feature
What is the current behavior?
I want render dom struct like whatwg says:

<body>
  <header>...</header>
  <nav>...</nav>
  <aside></aside>
  <main>...</main>
  <footer></footer>
</body>

But there get a warning:
index.js:1375 Warning: render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.

What is the expected behavior?
Without call ReactDOM.render multiple times, can i do this by strictly following the html specification?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions