import React from "react"

export default class FormErrorList extends React.Component {
  displayName = "Frig.FormErrorList"

  static defaultProps = {
    // This is the property of `errors` where Frig will look for form-level errors.
    // Set to "base" by default, for compatibility with Active Record.
    name: "base",
  }

  static contextTypes = {
    frigForm: React.PropTypes.shape({
      errors: React.PropTypes.object.isRequired,
    }).isRequired,
  }

  _errorsArray() {
    const { errors } = this.context.frigForm
    const { name } = this.props
    return errors.hasOwnProperty(name)
      ? errors.base
      : []
  }

  render() {
    const ThemedErrorList = this.context.frigForm.theme.component("errors")
    return <ThemedErrorList errors={this._errorsArray()} />
  }
}

@@ -577,57 +577,17 @@
 rors
-.hasOwnProperty(name)%0A      ? errors.base%0A      :
+%5Bname%5D %7C%7C
  %5B%5D%0A

Fix <FormErrorList/> always looking at `base` field