Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As with #1465 , the form library seems to be unnecessary in this form. Nevertheless, migration from
redux-form
andfinal-form
being what we want to achieve, a candidate was selected - in this case,react-hook-form
for its community support, modern API and small bundle footprint.Datepicker and Timepicker were wrapped in
Controller
-rhf
's version of<Field>
specifically geared for ui component libraries. The conversion for two fields fromredux-form
's field wasn't bad. Similar steps were taken, exposing props toDueDatePickerForm
from the vanilla version.UseEffect
was also employed to handle changes for the entirety of the state.react-hook-form
offerswatch
as a way to subscribe to all form values... and this PR makes use of a 'callback' implementation of that. Interestingly enough, it can be used to watch single fields or conditionally control parts of the form based on form values.More to come as we continue to explore react-hook-form in forms that do a bit more work...
Conversion to a functional component comes standard with this PR.