Skip to content

Instantly share code, notes, and snippets.

@lefnire
Last active January 31, 2018 22:39
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 lefnire/e8e1cd5275a5b43b22f9013c8f5c41e7 to your computer and use it in GitHub Desktop.
Save lefnire/e8e1cd5275a5b43b22f9013c8f5c41e7 to your computer and use it in GitHub Desktop.
import {Home} from './Home.js';
import React from 'react';
class App extends React.Component {
render() {
return (
<div className="container container-fluid">
<!-- maybe some menu / header stuff here. Anything that's shared b/w all your pages -->
<Home />
</div>
);
}
}
ReactDom.attach(App).to('#app'); // or however that stuff goes
import React from 'react';
export default class Home extends React.Component {
render() {
return (
<div>bla bla bla</div>
);
}
}
<html>
<head>
<script src="bundle.js" /> <!-- this is all your JS files combined and compiled using Webpack -->
<link href="styles.css" />
<!-- this import Bootstrap, which is a framework that gives you some nice styles / CSS out of the box (hence the classes / clasNames that you don't recognize, like "container") -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<div id="app" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment