Skip to content

Instantly share code, notes, and snippets.

@JustinTulloss
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinTulloss/411cc5d672595e962b3d to your computer and use it in GitHub Desktop.
Save JustinTulloss/411cc5d672595e962b3d to your computer and use it in GitHub Desktop.
browserify/react bootstrap
// 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