From e96019472289c2ae57dbe33188db56ee8e383e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=C4=83ng=20T=C3=BA?= <68631458+ngdangtu-vn@users.noreply.github.com> Date: Sat, 15 Feb 2025 14:22:14 +0700 Subject: [PATCH 1/2] fix(type): allow value from `Params` and `SearchParams` to be optional There is no way for us to know if these params is obligated or optional from the input. So it is safer to assume that they can be undefined. --- src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index 8e049b46..a7b3ac63 100644 --- a/src/types.ts +++ b/src/types.ts @@ -23,8 +23,8 @@ declare module "solid-js/web" { } } -export type Params = Record; -export type SearchParams = Record; +export type Params = Record; +export type SearchParams = Record; export type SetParams = Record< string, From fa46b67c09d04cf73266579e7daef45fbb7c6d96 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Wed, 23 Apr 2025 13:41:45 -0700 Subject: [PATCH 2/2] Create large-weeks-rescue.md --- .changeset/large-weeks-rescue.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/large-weeks-rescue.md diff --git a/.changeset/large-weeks-rescue.md b/.changeset/large-weeks-rescue.md new file mode 100644 index 00000000..c168575c --- /dev/null +++ b/.changeset/large-weeks-rescue.md @@ -0,0 +1,5 @@ +--- +"@solidjs/router": patch +--- + +fix(type): allow value from `Params` and `SearchParams` to be optional