New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v5] - Pass parent props into custom handleSubmit()
#1546
Comments
Have you considered generating your handleSubmit function with a factory that receives function handleSubmitFactory(policyType) {
return (values) => {
// createUser...
}
}
<form onSubmit={handleSubmitFromReduxForm(handleSubmitFactory(props.policyType))}> |
@naw There definitely are other ways to do it, and your suggestion seems like a fine one. Still, I think this could be an improvement to |
Released @baronswindle's fix in |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'd really like to be able to do something like this:
I reckon it's possible to do this by making
policyType
a form field and managing its value at the level where it would change using redux-form field properties, but it would be worlds easier to just pass parent props into thehandleSubmit()
function. It'd be pretty easy to do; I've already made the change on my personal fork that I'm using in a project. So if nobody has any objections, I'd happily make the PR.Let me know what you guys think.
The text was updated successfully, but these errors were encountered: