remix-validated-form 4.6.10 → 4.6.12

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -11,12 +11,12 @@ type ValidationBehaviorOptions = {
11
11
  type HandledProps = "name" | "defaultValue" | "defaultChecked";
12
12
  type Callbacks = "onChange" | "onBlur";
13
13
  type MinimalInputProps = {
14
- onChange?: (...args: any[]) => void;
15
- onBlur?: (...args: any[]) => void;
14
+ onChange?: ((...args: any[]) => void) | undefined;
15
+ onBlur?: ((...args: any[]) => void) | undefined;
16
16
  defaultValue?: any;
17
- defaultChecked?: boolean;
18
- name?: string;
19
- type?: string;
17
+ defaultChecked?: boolean | undefined;
18
+ name?: string | undefined;
19
+ type?: string | undefined;
20
20
  };
21
21
  type GetInputProps = <T extends MinimalInputProps>(props?: Omit<T, HandledProps | Callbacks> & Partial<Pick<T, Callbacks>>) => T;
22
22
 
package/dist/index.esm.js CHANGED
@@ -1030,7 +1030,9 @@ var useDefaultValuesFromLoader = ({
1030
1030
  const matches = useMatches();
1031
1031
  if (typeof formId === "string") {
1032
1032
  const dataKey = formDefaultValuesKey(formId);
1033
- const match = matches.reverse().find((match2) => match2.data && dataKey in match2.data);
1033
+ const match = matches.reverse().find(
1034
+ (match2) => match2.data && typeof match2.data === "object" && dataKey in match2.data
1035
+ );
1034
1036
  return match == null ? void 0 : match.data[dataKey];
1035
1037
  }
1036
1038
  return null;