Last active
May 6, 2018 19:00
-
-
Save mauricedb/7b73819ab8aab412efff81e2e73e2936 to your computer and use it in GitHub Desktop.
Use Bootstrap 4
This file contains hidden or 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
import { h, Component } from "preact"; | |
import { Router } from "preact-router"; | |
import Header from "./header"; | |
import Home from "../routes/home"; | |
import Movies from "../routes/movies"; | |
export default class App extends Component { | |
/** Gets fired when the route changes. | |
* @param {Object} event "change" event from [preact-router](http://git.io/preact-router) | |
* @param {string} event.url The newly routed URL | |
*/ | |
handleRoute = e => { | |
this.currentUrl = e.url; | |
}; | |
render() { | |
return ( | |
<div id="app" class="container"> | |
<Header /> | |
<Router onChange={this.handleRoute}> | |
<Home path="/" /> | |
<Movies path="/movies" /> | |
</Router> | |
</div> | |
); | |
} | |
} |
This file contains hidden or 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
import "bootstrap/dist/css/bootstrap.min.css"; | |
import App from "./components/app"; | |
export default App; |
This file contains hidden or 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
npm install bootstrap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment