Skip to content

Commit

Permalink
Switch path ignores query params
Browse files Browse the repository at this point in the history
<Switch path="/abc ... /> renders for /abc and /abc?a=1&b=2
  • Loading branch information
jdlehman committed Apr 15, 2015
1 parent 742351e commit 575bfb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/switcheroo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions modules/components/Switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export default class Switcher extends Component {
}

getHashLocation() {
return decodeURI(window.location.href.split('#')[1] || '');
return decodeURI(window.location.hash.slice(1).split('?')[0]);
}

getHistoryLocation() {
return decodeURI(window.location.pathname + window.location.search);
return decodeURI(window.location.pathname);
}

getSwitch(path) {
Expand Down

0 comments on commit 575bfb0

Please sign in to comment.