-
-
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.
fix: Props weren't correctly passed into prerender
- Loading branch information
1 parent
64479e7
commit bd44545
Showing
3 changed files
with
19 additions
and
17 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
32 changes: 17 additions & 15 deletions
32
packages/cli/tests/subjects/multiple-prerendering/index.js
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 |
---|---|---|
@@ -1,24 +1,26 @@ | ||
import { Component } from 'preact'; | ||
import { Router } from 'preact-router'; | ||
import Home from './routes/home'; | ||
import Route66 from './routes/route66'; | ||
import Custom from './routes/custom'; | ||
import { LocationProvider, Router } from 'preact-iso/router'; | ||
import { default as lazy, ErrorBoundary } from 'preact-iso/lazy'; | ||
|
||
const Home = lazy(() => import('./routes/home.js')); | ||
const Route66 = lazy(() => import('./routes/route66.js')); | ||
const Custom = lazy(() => import('./routes/custom.js')); | ||
import './style.css'; | ||
|
||
export default class App extends Component { | ||
handleRoute = e => { | ||
this.currentUrl = e.url; | ||
}; | ||
|
||
render(props) { | ||
return ( | ||
<div id="app"> | ||
<Router url={props.url} onChange={this.handleRoute} {...props}> | ||
<Home path="/" /> | ||
<Route66 path="/route66" /> | ||
<Custom path="/custom" {...props} /> | ||
</Router> | ||
</div> | ||
<LocationProvider> | ||
<div id="app"> | ||
<ErrorBoundary> | ||
<Router url={props.url} {...props}> | ||
<Home path="/" /> | ||
<Route66 path="/route66" /> | ||
<Custom path="/custom" {...props} /> | ||
</Router> | ||
</ErrorBoundary> | ||
</div> | ||
</LocationProvider> | ||
); | ||
} | ||
} |