Last active
August 29, 2015 14:22
-
-
Save CADBOT/8af7e374dc9725316814 to your computer and use it in GitHub Desktop.
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
// this is the last alert that works | |
alert('here in component app') | |
var MyApp = React.createClass({ | |
render: function() { | |
return (<p>hello</p>) | |
} | |
}) | |
// this alert is never reached | |
alert('about to export') | |
module.exports = myApp |
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
var React = require('react') | |
alert('here in index before require') | |
var MyApp = require('./components/myApp') | |
alert('returned from require') | |
React.render( | |
<MyApp /> | |
, document.getElementById('app')) |
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-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "js/app.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "browserify app/js/app.js -o public/js/bundle.js" | |
}, | |
"license": "ISC", | |
"dependencies": { | |
"jquery": "^2.1.4", | |
"react": "^0.13.3" | |
}, | |
"devDependencies": { | |
"babel": "^5.4.7", | |
"babel-core": "^5.4.7", | |
"babel-loader": "^5.1.3", | |
"browserify": "^10.2.3", | |
"node-libs-browser": "^0.5.2", | |
"reactify": "^1.1.1", | |
"webpack": "^1.9.10" | |
}, | |
"browserify": { | |
"transform": [ | |
"reactify" | |
] | |
} | |
} |
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
<html> | |
<head> | |
<title>React test</title> | |
</head> | |
<body> | |
<section id='app'></section> | |
<script src='public/js/bundle.js'></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment