Skip to content

Commit

Permalink
Change deprecated call, cleanup and and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsware committed Dec 28, 2022
1 parent 4504158 commit 008c04a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/inferno-router/src/StaticRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function addBasename(basename, location) {
return combineFrom(location, { pathname: addLeadingSlash(basename) + location.pathname });
}

function stripBasename(basename, location) {
function stripBasename(basename: string, location) {
if (!basename) {
return location;
}
Expand All @@ -114,7 +114,7 @@ function stripBasename(basename, location) {
return location;
}

return combineFrom(location, { pathname: location.pathname.substr(base.length) });
return combineFrom(location, { pathname: location.pathname.substring(base.length) });
}

function createLocation(location) {
Expand Down
5 changes: 2 additions & 3 deletions packages/inferno-router/src/resolveLoaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ function createClientSideRequest(
signal: AbortSignal,
// submission?: Submission
): Request {
let url = createClientSideURL(location);
url.hash = '';
let init: RequestInit = { signal };
const url = createClientSideURL(location);
const init: RequestInit = { signal };

// TODO: react-router supports submitting forms with loaders, but this needs more investigation
// related code is commented out in this file
Expand Down

0 comments on commit 008c04a

Please sign in to comment.