DigitMagazine

component in preact 2

Apr 20th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import './style';
  2. import { h } from 'preact';
  3. import { Router } from 'preact-router';
  4. import Header from './components/header';
  5. import Home from './routes/home';
  6. import Profile from './routes/profile';
  7. import Github from './routes/github'; // <--- Add this line
  8. export default () => (
  9. <div id="app">
  10. <Header />
  11. <Router>
  12. <Home path="/" />
  13. <Profile path="/profile/" user="me" />
  14. <Profile path="/profile/:user" />
  15. <Github path="/github" /> // <-- Attach the component with path
  16. </Router>
  17. </div>
  18. );
Add Comment
Please, Sign In to add comment