This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { setIn } from "final-form"; | |
import { useMemo } from "react"; | |
import { ObjectSchema, ValidationError, InferType } from "yup"; | |
/** | |
* Sets the `innerError.message` in an `errors` object at the key | |
* defined by `innerError.path`. | |
* @param {Record<string, string>} errors The object to set the error in. | |
* @param {ValidationError} innerError A `yup` field error. | |
* @returns {Record<string, string>} The result of setting the new error message onto `errors`. |