Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const createValidator = (
descriptor: any,
values: any,
callback: (errors: any[]) => void
): any => {
// @ts-ignore
schema.warning = (): void => {}
const validator = new schema(descriptor)
validator.validate(
values,
// @ts-ignore
(errors: any[]): void => {
callback(errors)
}
)
}
import React, { PureComponent, ReactElement, createRef } from 'react';
import PropTypes from 'prop-types';
import Schema from 'async-validator';
import classnames from 'classnames';
import { FormContext, FormItemContext } from './createContext';
import Icon from '../icon';
import { noop } from '../utils';
import Transition from '../transition';
import { ItemProps, triggerType } from './PropsType';
Schema.warning = noop;
class FormItem extends PureComponent {
static contextType = FormContext;
static defaultProps = {
prefixCls: 'za-form',
required: false,
};
static propTypes = {
prefixCls: PropTypes.string,
required: PropTypes.bool,
};
private initialData;