import { FieldValue, FormzValues } from "@zerry/react-formz-core"; import { DependentFieldProps } from "./DependentField.types"; /** * A `DependentField` is a field that depends on the value of another field or fields in * its owner `Form`. The `DependentField` has the exact same interface except with the added * ability to respond to changes in other fields within its parent form. * * Example Usage: * * ```tsx * ({ dob: values.dob })} * validate={(_, { dob }) => { * if (dob <= 21) { * return "Must be 21 years old" * } * }} * onDependenciesChange={(dependencies, actions) => { * if (dependencies.dob <= 21) { * actions.setValue("N/A"); * } * }} * /> * ``` * @param props {@link FieldProps} - The react props for the field component. * @typeParam `Values` {@link FormzValues} - The values of the parent form i.e. the data structure for your form. * @typeParam `Key` {@link FieldId} - The input/field `name` property. This value should correspond to a property in the form. * @typeParam `Value` {@link FieldValue} - The value of the input/field. * @typeParam `Ref` - The react ref. * @typeParam `DependentValues` - The dependent values that this field will subscribe to. * */ declare const DependentField: = Partial>(props: DependentFieldProps) => JSX.Element; export default DependentField; //# sourceMappingURL=DependentField.d.ts.map