Skip to content

Commit a90f4a9

Browse files
authored
Update LocaleSwitcherSelect.tsx to use @ts-expect-error instead of casting params as any
1 parent 0feaf15 commit a90f4a9

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

examples/example-app-router/src/components/LocaleSwitcherSelect.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@ export default function LocaleSwitcherSelect({
2525
const nextLocale = event.target.value;
2626
startTransition(() => {
2727
router.replace(
28-
{
29-
pathname,
30-
// TypeScript validates that only known `params` are used in combination
31-
// with a given `pathname`. Since the two will always match for the current
32-
// route, we can skip runtime checks.
33-
params: params as any
34-
},
28+
// @ts-expect-error -- TypeScript will validate that only known `params`
29+
// are used in combination with a given `pathname`. Since the two will
30+
// always match for the current route, we can skip runtime checks.
31+
{ pathname, params },
3532
{locale: nextLocale}
3633
);
3734
});

0 commit comments

Comments
 (0)