Skip to content

Commit

Permalink
remove unused const
Browse files Browse the repository at this point in the history
  • Loading branch information
Nike Mazur authored and Nike Mazur committed Feb 26, 2020
1 parent 16a5794 commit 804a4cf
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/hocs/finalForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function withFinalForm({
if(!key && !configs.onSubmit) {
throw new Error('OnSubmit is required')
}
let getfields = function() { return [] }
return function HOC(ChildComponent) {
return class FinalFormHOC extends Component {
constructor(props) {
Expand Down Expand Up @@ -75,11 +74,7 @@ export default function withFinalForm({
}

handleValidate(values) {
const validationErrors = validate(values, this.props)
if(typeof validationErrors === 'object') {
return pick(validationErrors, getfields())
}
return validationErrors
return validate(values, this.props)
}

render() {
Expand All @@ -90,7 +85,6 @@ export default function withFinalForm({
validate={this.handleValidate}
initialValues={this.initialValues}
render={({ handleSubmit, form, submitting, ...rest }) => {
getfields = form.getRegisteredFields
return (
<ChildComponent
{...this.props}
Expand Down

0 comments on commit 804a4cf

Please sign in to comment.