Skip to content
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

File Input does not get reset after redux-form reset() #387

Closed
chawes13 opened this issue Oct 10, 2019 · 3 comments · Fixed by #380 or #481
Closed

File Input does not get reset after redux-form reset() #387

chawes13 opened this issue Oct 10, 2019 · 3 comments · Fixed by #380 or #481
Assignees
Labels
Milestone

Comments

@chawes13
Copy link
Contributor

chawes13 commented Oct 10, 2019

The form value in the redux store gets cleared, but neither the internal component state (used for generating preview) or the input's value get cleared

@dpikt
Copy link
Contributor

dpikt commented Oct 10, 2019

Can you bundle a fix for this into #346? Should be doable with a lifecycle hook. https://reactjs.org/docs/react-component.html#static-getderivedstatefromprops perhaps?

@dpikt dpikt removed their assignment Oct 10, 2019
@dpikt
Copy link
Contributor

dpikt commented Oct 10, 2019

Not sure how this article factors in... 🤔 https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html

@chawes13
Copy link
Contributor Author

@dpikt My takeaway from that is that we should store an array of files as the value for the input and get rid of internal state. Would that approach lend itself more naturally to a field array?

@chawes13 chawes13 added this to the v6 milestone Aug 31, 2021
@chawes13 chawes13 linked a pull request Sep 27, 2021 that will close this issue
10 tasks
@chawes13 chawes13 self-assigned this Sep 27, 2021
@chawes13 chawes13 linked a pull request Oct 21, 2021 that will close this issue
5 tasks
@chawes13 chawes13 mentioned this issue Jun 23, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants