Skip to content

Instantly share code, notes, and snippets.

@ptica
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptica/61243602cc3f56bb3be0 to your computer and use it in GitHub Desktop.
Save ptica/61243602cc3f56bb3be0 to your computer and use it in GitHub Desktop.
# index.html
<body>
<div id="jumbotron">
<h1>Hello, world!</h1>
<p>...</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
<div id="some">Some other content</div>
<body>
React.render(<c>, document.getElementById('jumbotron')); // if I render to body, I will lose div#some
# I tried to return the inner content as an array, like this, but that yields an error
var c = React.createClass({
render: function() {
return ([
<h1/>,
<p/>,
<p/>
])
}
});
# so it seems to me that react forces me into this matryoshka code:
<body>
<div id="react-mount-point">
<div id="component-root-element">
<h1>Hello, world!</h1>
<p>...</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
</div>
<div id="some">Some other content</div>
<body>
# any idea how to avoid that is appreciated!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment