Skip to content

Commit b6f13d1

Browse files
committed
refactor: Drop half implemented url prop on LocationProvider
1 parent aa86fa2 commit b6f13d1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: src/router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const exec = (url, route, matches) => {
7171
};
7272

7373
export function LocationProvider(props) {
74-
const [url, route] = useReducer(UPDATE, props.url || location.pathname + location.search);
74+
const [url, route] = useReducer(UPDATE, location.pathname + location.search);
7575
const wasPush = push === true;
7676

7777
const value = useMemo(() => {

Diff for: test/router.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,15 @@ describe('Router', () => {
3737

3838
it('should strip trailing slashes from path', async () => {
3939
render(
40-
<LocationProvider url="/a/">
40+
<LocationProvider>
4141
<ShallowLocation />
4242
</LocationProvider>,
4343
scratch
4444
);
4545

46+
loc.route('/a/');
47+
await sleep(1);
48+
4649
expect(loc).to.deep.include({
4750
url: '/a/',
4851
path: '/a',

0 commit comments

Comments
 (0)