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
Feature request: easier ways to get state of the enclosing form on context #4037
Comments
That great type of developer laziness that leads us to spend hours and great effort to perfect our code ⭐️✅. My tendency would be to start with implementing #3246, and then users can pair that with the various already available selectors. Then implementing your (effectively) |
does #3246 really need to be a HOC? Could just be a render props component. |
Good point, following the recent trend on that one seems beneficial - a render props component would be great. Would you be willing to raise a PR for that? I'm also increasingly convinced on second read that your |
Yeah, I'll make a PR for the render props comp! |
I made the PR! |
@jedwards1211 thanks again for this, very awesome. With #4038 merged, I'll go ahead and close this ;). |
Fix released 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 often want to make generic components that I can plunk into any form to show stuff like the form's submission status and error. For instance:
But this is a PITA to use because I have to either
submitting
,submitSucceeded
,submitFailed
, anderror
injected into each one of my forms (who's got time for that?)reduxForm({form: 'ugh'})(SubmitStatus)
(still too much work. I'm lazy and make no apologies for it!)redux-form
puts everything I need to know on context and in redux state, so I accept nothing less than a component that magically fetches those props with no extra effort on my part:I wrote some elegant utilities to de-suck this situation. Perhaps you may be interested in some or all of their functionality in a PR. Here is what the resulting code looks like:
Here is the
FormContext
render props component:And here is the magic
createFormSelector
function:The text was updated successfully, but these errors were encountered: