Change Type
Correction
Proposed Changes
When using a useSearchParams with a schema containing .optional properties, these properties are never reflected in the URL. This should be mentioned on the docs, if it isn't a bug.
Basic example:
export const craftingSearchSchema = z.object({
tab: z.enum(["harvesting", "manufacturing", "enchanting", "forging"]).default("harvesting"),
table: z.string().optional(),
});
The table prop will never show up in the url. tab will. Changing table to use a default("") makes it appear.
Change Type
Correction
Proposed Changes
When using a
useSearchParamswith a schema containing.optionalproperties, these properties are never reflected in the URL. This should be mentioned on the docs, if it isn't a bug.Basic example:
The
tableprop will never show up in the url.tabwill. Changingtableto use adefault("")makes it appear.