Skip to content

Commit 0e8d391

Browse files
committed
Remove deprecated createLocation on serverside (remix-run/history#302)
1 parent 2bd41e3 commit 0e8d391

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

server/server.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import ReactDOMServer from 'react-dom/server';
55
import { Provider } from 'react-redux';
66
import { RouterContext, match } from 'react-router';
77
import { routes } from '../common/routes';
8-
import createLocation from 'history/lib/createLocation';
98
import config from './config';
109
import configureStore from '../common/config/store';
1110
import serveStatic from 'serve-static';
@@ -34,9 +33,6 @@ app.use('/dist', serveStatic(path.join(__dirname, '../dist')));
3433
app.use(handleRender);
3534

3635
function handleRender(req, res) {
37-
// history location
38-
const location = createLocation(req.url);
39-
4036
// Compile an initial state
4137
// This can come from the server somewhere if you want to pre-populate the
4238
// app's initial state.
@@ -50,7 +46,7 @@ function handleRender(req, res) {
5046

5147
// See react-router's Server Rendering section:
5248
// https://github.com/rackt/react-router/blob/master/docs/guides/advanced/ServerRendering.md
53-
match({ routes, location }, (error, redirectLocation, renderProps) => {
49+
match({ routes, location: req.url }, (error, redirectLocation, renderProps) => {
5450
if (redirectLocation) {
5551
res.redirect(301, redirectLocation.pathname + redirectLocation.search);
5652
} else if (error) {

0 commit comments

Comments
 (0)