How to use the async-validator.warning function in async-validator

To help you get started, we’ve selected a few async-validator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fluent-org / fluent-ui / packages / fluent-ui / src / Form / Form.validator.ts View on Github external
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)
    }
  )
}
github JeromeLin / zarm-web / components / form / FormItem.tsx View on Github external
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;

async-validator

validate form asynchronous

MIT
Latest version published 3 years ago

Package Health Score

76 / 100
Full package analysis