taro-form-react 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { useFormContext } from "../context/FormContext";
|
|
3
3
|
export type FormProviderProps = {
|
|
4
|
-
children: (context: ReturnType<typeof useFormContext>) => React.ReactNode;
|
|
4
|
+
children: (context: Omit<ReturnType<typeof useFormContext>, "registerField" | "unregisterField" | "setFieldValue" | "setFields" | "resetFields" | "setFieldError" | "setData">) => React.ReactNode;
|
|
5
5
|
};
|
|
6
6
|
declare const FormProvider: React.FC<FormProviderProps>;
|
|
7
7
|
export default FormProvider;
|
|
@@ -5,6 +5,7 @@ import FormLabel from "./components/Label";
|
|
|
5
5
|
import FormProvider from "./components/Provider";
|
|
6
6
|
import FormSync from "./components/Sync";
|
|
7
7
|
import type { Field, FormContextProps, FormProviderConfiguration } from "./context/FormContext";
|
|
8
|
+
import { useFormContext } from "./context/FormContext";
|
|
8
9
|
export type FormActions = Pick<FormContextProps, "setFieldValue" | "getFieldValue" | "getFieldsValue" | "getFieldsFormattedValue" | "setFields" | "getFields" | "resetFields" | "setFieldError" | "getFieldError" | "validateFields" | "isFieldsTouched"> & {
|
|
9
10
|
submit: () => Promise<Record<string, any> | undefined>;
|
|
10
11
|
reset: () => void;
|
|
@@ -33,3 +34,4 @@ interface FormComponent extends React.ForwardRefExoticComponent<FormProps & Reac
|
|
|
33
34
|
}
|
|
34
35
|
declare const Form: FormComponent;
|
|
35
36
|
export default Form;
|
|
37
|
+
export { useFormContext };
|