Created
August 24, 2014 12:26
-
-
Save fdb/bc697dcdb4f0a1ac7347 to your computer and use it in GitHub Desktop.
watchify case mismatch proof-of-concept
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="bundle.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var React = require('React'); // NOTE: capitalized "react" in require | |
exports.Kanvas = React.createClass({ | |
displayName: 'Kanvas', | |
render: function () { | |
return React.DOM.div(null, {ref: 'canvas'}); | |
}, | |
componentDidMount: function () { | |
var canvas = this.refs.canvas.getDOMNode() | |
console.log(canvas); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var React = require('react'); // NOTE: lowercase "react" in require | |
var kanvas = require('./kanvas'); | |
var App = React.createClass({ | |
displayName: 'App', | |
render: function () { | |
return React.DOM.div(null, | |
kanvas.Kanvas()); | |
} | |
}); | |
document.addEventListener('DOMContentLoaded', function () { | |
React.renderComponent(App(), document.body); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "react-browserify", | |
"version": "0.0.0", | |
"main": "index.js", | |
"scripts": { | |
"browserify": "browserify src/main.js -o bundle.js", | |
"watchify": "watchify src/main.js -o bundle.js -v", | |
}, | |
"dependencies": { | |
"react": "~0.11.1", | |
"browserify": "~5.10.1", | |
"watchify": "~1.0.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment