Last active
August 29, 2015 14:09
-
-
Save JustinTulloss/411cc5d672595e962b3d to your computer and use it in GitHub Desktop.
browserify/react bootstrap
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
// Here's the bootstrap, in something like "start.js" | |
import App from './components/App'; | |
import React from 'react'; | |
React.render(<App data={global.MyData}/>, document.getElementById('app')); | |
// Here's the index | |
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<script> | |
window.MyData = { | |
caption: "Here's a caption | |
}; | |
</script> | |
<link href="/static/package.css" rel="stylesheet" type="text/css"> | |
</head> | |
<body> | |
<div id="fb-root"></div> | |
<div id="app"></div> | |
<script src="/static/package.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment