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 a35559b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 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,10 +85,9 @@ export default function withFinalForm({
validate={this.handleValidate}
initialValues={this.initialValues}
render={({ handleSubmit, form, submitting, ...rest }) => {
getfields = form.getRegisteredFields
return (
<ChildComponent
{...this.props}
{...this.props}чё
handleSubmit={handleSubmit}
valid={isFormValid(rest) }
submitting={submitting}
Expand Down

0 comments on commit a35559b

Please sign in to comment.