These are chat archives for milankinen/livereactload

7th
Mar 2016
Muhammad Aref
@LeoAref
Mar 07 2016 12:25
Hi there
I'm using browserify with React and I'm confused with something
Let's assume I have a file that have a sub-component code like that
var React = require('react');

var Search = React.createClass({
    return: function () {
         return (<div id="search"></div>);
    }
});

module.exports = Search;
and the main file that requires Search component and also required React
Muhammad Aref
@LeoAref
Mar 07 2016 12:30
Let's assume I have a file that have a sub-component code like that
var React = require('react');
var Search = require('Search');

var Main = React.createClass({
    return: function () {
         return (<div id="main">
               <Search />            
        </div>);
    }
});

module.exports = Main;
Now the question is, after using browserify like: browsrify main.js -o build.js
the build.js file will have two copies of React core code??
another thing, why all file contents are imported? it should import only exports