reakit
Version:
Toolkit for building accessible rich web apps with React
10 lines (8 loc) • 305 B
text/typescript
import { unstable_FormState } from "../FormState";
import { unstable_getIn } from "../utils/getIn";
export function shouldShowError<V>(
{ touched, errors }: Pick<unstable_FormState<V>, "touched" | "errors">,
name: any
) {
return !!(unstable_getIn(touched, name) && unstable_getIn(errors, name));
}