terrierscript
6/30/2016 - 12:03 PM

Reactでprototypingする時にdocument.bodyにレンダリングすんな!って怒られた時の回避 ref: http://qiita.com/inuscript/items/552b8e332f95d0928b2b

Reactでprototypingする時にdocument.bodyにレンダリングすんな!って怒られた時の回避 ref: http://qiita.com/inuscript/items/552b8e332f95d0928b2b

ReactDom.render(
  <Main />,
  document.body.appendChild(document.createElement('div'))
)
ReactDom.render(
  <Main />,
  document.body.appendChild(document.createElement('div'))
)
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
)