React Base Fiddle (JSX)
Starting point for creating JSFiddles with React. This uses React with Addons.
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/JSXTransformer.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/react-with-addons.js"></script>
<script src="https://facebook.github.io/react/js/jsfiddle-integration.js"></script>
<h3>WITH REACT</h3>
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
<h3>WITHOUT REACT</h3>
<div>
<!--[if lte IE 9]>
<p class = "accent ie">
<![endif]-->
<!--[if !IE]> -->
<p class = "accent notIE">
<!-- <![endif]-->
If this is IE, this text should be red. If not it should be blue.
</p>
</div>
CSS
.accent {
padding: 1em;
margin: 0 -1em;
border: 1px solid;
}
.ie {
color: red;
}
.notIE {
color: blue;
}
JavaScript 1.7
var Hello = React.createClass({
render: function() {
return (
<div>
<!--[if lte IE 9]>
<p className = "accent ie">
<![endif]-->
<!--[if !IE]> -->
<p className = "accent notIE">
<!-- <![endif]-->
If this is IE, this text should be red. If not it should be blue.
</p>
</div>
);
}
});
React.render(<Hello name="World" />, document.getElementById('container'));