Skip to content

Instantly share code, notes, and snippets.

@terrierscript
Last active July 15, 2016 14:54
Show Gist options
  • Select an option

  • Save terrierscript/bab38b0825b67e73a3b647d32f9186ed to your computer and use it in GitHub Desktop.

Select an option

Save terrierscript/bab38b0825b67e73a3b647d32f9186ed to your computer and use it in GitHub Desktop.
Reactでprototypingする時にdocument.bodyにレンダリングすんな!って怒られた時の回避 ref: http://qiita.com/inuscript/items/552b8e332f95d0928b2b
ReactDom.render(
  <Main />,
  document.body
)
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.
ReactDom.render(
  <Main />,
  document.body.appendChild(document.createElement('div'))
)
ReactDom.render(
  <Main />,
  document.body.appendChild(document.createElement('div'))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment