Skip to content

Commit 5376e65

Browse files
fix: createStableHref to remove properly the blocked querystrings (#895)
1 parent 95e59af commit 5376e65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hooks/useSection.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export const addBlockedQS = (queryStrings: string[]): void => {
3939
/** Returns new props object with prop __cb with `pathname?querystring` from href */
4040
const createStableHref = (href: string): string => {
4141
const hrefUrl = new URL(href!, "http://localhost:8000");
42-
hrefUrl.searchParams.forEach((_: string, qsName: string) => {
42+
const qsList = [...hrefUrl.searchParams.keys()];
43+
qsList.forEach((qsName: string) => {
4344
if (BLOCKED_QS.has(qsName)) hrefUrl.searchParams.delete(qsName);
4445
});
4546
hrefUrl.searchParams.sort();

0 commit comments

Comments
 (0)