File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ const routesToPrerender = fs
22
22
; ( async ( ) => {
23
23
// pre-render each route...
24
24
for ( const url of routesToPrerender ) {
25
- const context = { }
26
- const appHtml = await render ( url , context )
25
+ const appHtml = await render ( url )
27
26
28
27
const html = template . replace ( `<!--app-html-->` , appHtml )
29
28
Original file line number Diff line number Diff line change @@ -73,13 +73,7 @@ export async function createServer(
73
73
render = ( await import ( './dist/server/entry-server.js' ) ) . render
74
74
}
75
75
76
- const context = { }
77
- const appHtml = render ( url , context )
78
-
79
- if ( context . url ) {
80
- // Somewhere a `<Redirect>` was rendered
81
- return res . redirect ( 301 , context . url )
82
- }
76
+ const appHtml = render ( url )
83
77
84
78
const html = template . replace ( `<!--app-html-->` , appHtml )
85
79
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import ReactDOMServer from 'react-dom/server'
2
2
import { StaticRouter } from 'react-router-dom/server'
3
3
import { App } from './App'
4
4
5
- export function render ( url , context ) {
5
+ export function render ( url ) {
6
6
return ReactDOMServer . renderToString (
7
- < StaticRouter location = { url } context = { context } >
7
+ < StaticRouter location = { url } >
8
8
< App />
9
9
</ StaticRouter > ,
10
10
)
You can’t perform that action at this time.
0 commit comments