The article shows how to enhance the standard following HelloWorld, with Grunt and Browserify
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
Gruntfile.js
README.md
package.json

README.md

Basic HelloWorld with ReactJS, Grunt and Browserify

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.