fac-12 / peppr

A web application for saving recipes

Home Page:https://peppr.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redux form submit handlers

m4v15 opened this issue · comments

Again, amazing work on using redux form, like I say, I've heard a lot of stories of people struggling with it, but looking at your stuff and the docs this looks pretty solid (although I am also new to it). One thing that jumped out to me was how you were passing in the submit handlers - such as here, or here and then binding this to the in built(?) handleSubmit prop from redux-form (here and here. The bind looked weird to me seeing as your using connect etc, so I had a mess around and instead of creating those new methods you can just pass in your functions straight into submit and it seems to work fine on my machine: onSubmit={handleSubmit(this.props.checkUrl).

CAVEAT I'm pretty sure this is better practice, and couldn't see anything in redux-form docs to indicate otherwise but there appears to be a fair bit of discussion around it so maybe you were aware of this and have done it for a reason? Anyway thought it was still worth mentioning to you all