I have a Form where the user inputs two dates and I make a Request to the Backend to check if those Dates are on a public holiday or not (which would mean the user needs to select a different Date).
To use the Caching from useQuery I would like to define my Query somewhere
function useIsPublicHoliday(date: Date) { return useQuery({ // … })}
function useIsPublicHoliday(date: Date) { return useQuery({ // … })}
and then use it in the validation on the Field
<Field name={…} validators={{ onBlur: () => { // ?? How do get the the public holiday data here ?? } }} children={…}/>
<Field name={…} validators={{ onBlur: () => { // ?? How do get the the public holiday data here ?? } }} children={…}/>