class Add extends Component {

  constructor(props) {
    super(props)
    this.state = {
    }
  }

  upRefs = refsHandlers => {
    this.refsHandlers = refsHandlers
  }

  handleSubmit = async (initErrors, initValues) => {
    const values = Object.assign(initValues, {ruleType: RULE_TYPES[this.props.match.params.ruleType].id})
    const errorKeys = Object.keys(initErrors)
    if (!errorKeys.length) {
      try {
        const res = await addRule(values)
        this.props.history.push(`/${this.props.match.params.ruleType}/shopList`)
        return res
      } catch (error) {
        errHandler(error)
        throw new Error(error)
      }
    } else {
      throw new Error('some things went wrong')
    }
  }

  render = () => {
    // 面包屑
    const breadCrumbData = getBreadCrumb(RULE_TYPES[this.props.match.params.ruleType].breadCrumbKey.add)
    const formProps = {
      breadCrumbData,
      type: this.props.match.params.ruleType,
      onSubmit: this.handleSubmit,
      upRefs: this.upRefs,
      ...this.state,
      ...this.props,
    }
    return <Form {...formProps} />
  }
}
export default Add
Add.defaultProps = {
}
Add.propTypes = {
}
explain this code