Skip to content

Commit a1ac675

Browse files
committed
refactor: Drop half implemented url prop on LocationProvider
1 parent 674a195 commit a1ac675

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
@@ -97,8 +97,7 @@ export const exec = (url, route, matches = {}) => {
9797
* @param {import('preact').ComponentChildren} [props.children]
9898
*/
9999
export function LocationProvider(props) {
100-
// @ts-expect-error - props.url is not implemented correctly & will be removed in the future
101-
const [url, route] = useReducer(handleNav, props.url || location.pathname + location.search);
100+
const [url, route] = useReducer(handleNav, location.pathname + location.search);
102101
if (props.scope) scope = props.scope;
103102
const wasPush = push === true;
104103

test/router.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,15 @@ describe('Router', () => {
6060

6161
it('should strip trailing slashes from path', async () => {
6262
render(
63-
<LocationProvider url="/a/">
63+
<LocationProvider>
6464
<ShallowLocation />
6565
</LocationProvider>,
6666
scratch
6767
);
6868

69+
loc.route('/a/');
70+
await sleep(1);
71+
6972
expect(loc).to.deep.include({
7073
url: '/a/',
7174
path: '/a',

0 commit comments

Comments
 (0)