How to use the prop-types-extra/lib/elementType.isRequired function in prop-types-extra

To help you get started, we’ve selected a few prop-types-extra 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 jquense / react-formal / src / Summary.js View on Github external
/**
     * An error message renderer, Should return a `ReactElement`
     * ```
     * function(
     *   message: string,
     *   idx: number,
     *   errors: array
     * ) -> ReactElement
     * ```
     */
    formatMessage: PropTypes.func.isRequired,

    /**
     * A DOM node tag name or Component class the Message should render as.
     */
    as: elementType.isRequired,

    /**
     * A css class that should be always be applied to the Summary container.
     */
    errorClass: PropTypes.string,

    /**
     * Specify a group to show errors for, if empty all form errors will be shown in the Summary.
     */
    group: PropTypes.string,
  }

  static defaultProps = {
    as: 'ul',
    formatMessage: (message, idx) =&gt; <li>{message}</li>,
  }