This commit is contained in:
@@ -16,9 +16,8 @@ export function useSearch<Schema extends s.Schema = s.Schema>(
|
||||
const [location, navigate] = useLocation();
|
||||
const defaults = useMemo(() => {
|
||||
return mergeObject(
|
||||
// @ts-ignore
|
||||
schema.template({ withOptional: true }),
|
||||
options?.defaultValue ?? {},
|
||||
schema.template({ withOptional: true }),
|
||||
);
|
||||
}, [JSON.stringify({ schema, dflt: options?.defaultValue })]);
|
||||
const [value, setValue] = useState<s.StaticCoerced<Schema>>(defaults);
|
||||
|
||||
Reference in New Issue
Block a user