-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added multiroute prerendering (#192)
* Added multiroute prerendering * Added documentation for prerendering multiple routes * Fixed missing semicolon
- Loading branch information
1 parent
136f5ae
commit db1641e
Showing
9 changed files
with
117 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { h, Component } from 'preact'; | ||
import { Router } from 'preact-router'; | ||
|
||
const Home = () => <div>Home</div>; | ||
|
||
const Route66 = () => <div>Route66</div>; | ||
|
||
export default class App extends Component { | ||
handleRoute = e => { | ||
this.currentUrl = e.url; | ||
}; | ||
|
||
render() { | ||
return ( | ||
<div id="app"> | ||
<Router onChange={this.handleRoute}> | ||
<Home path="/" /> | ||
<Route66 path="/route66" /> | ||
</Router> | ||
</div> | ||
); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "preact-app", | ||
"version": "0.0.1", | ||
"private": true, | ||
"dependencies": { | ||
"preact": "latest", | ||
"preact-compat": "latest", | ||
"preact-router": "latest" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.1.1", | ||
"eslint-config-synacor": "^1.0.1", | ||
"if-env": "^1.0.0", | ||
"preact-cli": "file:../../../" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{ "url": "/" }, { "url": "/route66", "title": "Route66"}] |