require is not a React api, and it is not a native api browser (yet).
require commonjs node.js, node.js, , .
- node, , , nodejs, .
require, , (, , )
require, , webpack , .
'index.js'
require('./app.js');
alert('index works');
app.js
alert('app works');
next cli
npm install -g browserify
browserify index.js > bundle.js
bundle.js, html
<script src="bundle.js"></script>
,
, ,
npm install react
app.js,
var React = require('react');
React.createClass({
render: function(){}
})