Skip to content

Commit

Permalink
[BUGFIX] - only use path in route matching #38
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelBenin committed May 17, 2017
1 parent 8add722 commit 70b8653
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const store = configureStore(browserHistory, bootstrappedConfig, env);
const routesToMatch = getRoutesWithStore(store);

browserHistory.listen((location /* , action*/) => {
const url = `${location.pathname}${location.search}${location.hash}`;
const url = `${location.pathname}`;
const branch = matchRoutes(routesToMatch, url);
branch.map(function matchMap({ route, match }) {
return route.loadData ? route.loadData(match) : P.resolve(null);
Expand Down
2 changes: 1 addition & 1 deletion src/server/middleware/react_router_middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default (req, res) => {

const routes = getRoutesWithStore(store);

const branch = matchRoutes(routes, req.url);
const branch = matchRoutes(routes, req.path);

const promises = branch.map(function matchMap({ route, match }) {
return route.loadData ? route.loadData(match) : P.resolve(null);
Expand Down

0 comments on commit 70b8653

Please sign in to comment.