Skip to content

Commit e0f061a

Browse files
authored
Handling some missed url params with the nuqs defaults (#6375)
1 parent d7ff66e commit e0f061a

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

ui/packages/shared/profile/src/hooks/urlParsers.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313

1414
import {createParser, parseAsArrayOf, parseAsBoolean, parseAsInteger, parseAsString} from 'nuqs';
1515

16-
const opts = {history: 'replace' as const};
17-
18-
// === Base parsers with common options ===
19-
export const stringParam = parseAsString.withOptions(opts);
20-
export const boolParam = parseAsBoolean.withOptions(opts);
21-
export const intParam = parseAsInteger.withOptions(opts);
22-
export const commaArrayParam = parseAsArrayOf(parseAsString, ',').withOptions(opts);
16+
// === Base parsers ===
17+
export const stringParam = parseAsString;
18+
export const boolParam = parseAsBoolean;
19+
export const intParam = parseAsInteger;
20+
export const commaArrayParam = parseAsArrayOf(parseAsString, ',');
2321

2422
// === Param-specific parsers with defaults ===
2523
export const invertCallStackParser = boolParam.withDefault(false);
@@ -34,5 +32,5 @@ export function jsonParser<T>(): ReturnType<typeof createParser<T>> {
3432
parse: (value: string) => JSON.parse(value) as T,
3533
serialize: (value: T) =>
3634
JSON.stringify(value, (_, v) => (typeof v === 'bigint' ? v.toString() : v)),
37-
}).withOptions(opts);
35+
});
3836
}

0 commit comments

Comments
 (0)