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