Last active
August 29, 2015 14:17
-
-
Save ptica/61243602cc3f56bb3be0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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