Skip to content

Docs: do not render components to document.body#3483

Merged
zpao merged 1 commit intofacebook:masterfrom
julen:docs/document-body-footgun
Mar 23, 2015
Merged

Docs: do not render components to document.body#3483
zpao merged 1 commit intofacebook:masterfrom
julen:docs/document-body-footgun

Conversation

@julen
Copy link
Copy Markdown
Contributor

@julen julen commented Mar 23, 2015

Rendering to document.body in the examples is conveniently short, but it can
be misleading at the same time, especially for newcomers.

While it's possible to render React components to document.body, any 3rd
party scripts can also mess up with it, and it can have unintended consequences
and be source of difficult-to-trace bugs.

Rendering to `document.body` in the examples is conveniently short, but it can
be misleading at the same time, especially for newcomers.

While it's possible to render React components to `document.body`, any 3rd
party scripts can also mess up with it, and it can have unintended consequences
and be source of difficult-to-trace bugs.
@gaearon
Copy link
Copy Markdown
Collaborator

gaearon commented Mar 23, 2015

+1 been burned hard by this

@zpao
Copy link
Copy Markdown
Member

zpao commented Mar 23, 2015

👍 Thanks for this!

zpao added a commit that referenced this pull request Mar 23, 2015
Docs: do not render components to `document.body`
@zpao zpao merged commit 11983d8 into facebook:master Mar 23, 2015
@julen julen deleted the docs/document-body-footgun branch March 23, 2015 18:31
zpao added a commit that referenced this pull request Apr 3, 2015
Docs: do not render components to `document.body`
dilberx pushed a commit to dilberx/react that referenced this pull request Apr 15, 2026
Docs: do not render components to `document.body`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants