Created
June 26, 2021 10:57
-
-
Save Cerwyn/689d22953dc9e635d746c50a77f0852f to your computer and use it in GitHub Desktop.
preact
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 { html } from 'htm/preact'; | |
| import { Router } from 'preact-router'; | |
| import Header from './header'; | |
| // Code-splitting is automated for `routes` directory | |
| import Home from '../routes/home'; | |
| import Profile from '../routes/profile'; | |
| const App = () => { | |
| return html` | |
| <div id="app"> | |
| <${Header} /> | |
| <${Router}> | |
| <${Home} path="/" /> | |
| <${Profile} path="/profile/" user="me" /> | |
| <${Profile} path="/profile/:user" /> | |
| </${Router}> | |
| </div> | |
| `; | |
| } | |
| export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment