Skip to content

Commit 7fecc07

Browse files
committed
refactor: Drop half implemented url prop on LocationProvider
1 parent 893375c commit 7fecc07

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
@@ -44,12 +44,15 @@ describe('Router', () => {
4444

4545
it('should strip trailing slashes from path', async () => {
4646
render(
47-
<LocationProvider url="/a/">
47+
<LocationProvider>
4848
<ShallowLocation />
4949
</LocationProvider>,
5050
scratch
5151
);
5252

53+
loc.route('/a/');
54+
await sleep(1);
55+
5356
expect(loc).to.deep.include({
5457
url: '/a/',
5558
path: '/a',

0 commit comments

Comments
 (0)