This is code support for an article on my blog : http://blog.overnetcity.com
The article shows how to enhance the standard following HelloWorld, with Grunt
and Browserify
:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.11.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.11.2/JSXTransformer.js"></script>
</head>
<body>
<div id="content"></div>
<script type="text/jsx">
/** @jsx React.DOM */
var hello = React.createClass({
render: function() {
return <div>Hello, {this.props.name}!</div>
}
});
React.renderComponent(
<hello name="World" />,
document.getElementById('content')
);
</script>
</body>
</html>
Bonus, the React library is loaded via a CDN while still used with browserify inside your code.