I have this validate function component how I can use It to return callback funcion?
the first file only for check validity
export function checkValidity(value, rules, shouldValidat) {
let isValid = true;
return isValid;
}
the second file caller
import { checkValidity } from "../UI/CheckValidity";
let res = checkValidity(vlaue, validationRules, shouldValidat);
callback = () =>{
alert("call back function is done");
}
how I can call the callback function from the first file using react js?