Skip to content

Commit 4e79797

Browse files
committed
refactor: Drop half implemented url prop on LocationProvider
1 parent b2725a0 commit 4e79797

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/router.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ export const exec = (url, route, matches = {}) => {
8080
* @type {import('./router.d.ts').LocationProvider}
8181
*/
8282
export function LocationProvider(props) {
83-
// @ts-expect-error - props.url is not implemented correctly & will be removed in the future
84-
const [url, route] = useReducer(UPDATE, props.url || location.pathname + location.search);
83+
const [url, route] = useReducer(UPDATE, location.pathname + location.search);
8584
if (props.scope) scope = props.scope;
8685
const wasPush = push === true;
8786

test/router.test.js

Lines changed: 4 additions & 1 deletion
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)