React Base Fiddle (JSX)

Starting point for creating JSFiddles with React. This uses React with Addons.

by Cody Lindley

HTML

<script src="https://fb.me/react-with-addons-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
<div id="app"></div>

Babel + JSX

var reactNodeLi = React.createElement('div',{
	foo:'bar',
	id:'li1',
	//note use of JS class property representing class attribute below
	//i.e., className
	className:'blue',
	'data-test':'test',
	'aria-test':'test',
	//note use of JS camel-cased CSS property below
	//i.e., backgroundColor
	style:{backgroundColor:'red'}
},
'text'
);

console.log(reactNodeLi.props.foo); //logs bar

ReactDOM.render(reactNodeLi, document.getElementById('app'));