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

STSMACOM-827 #1466

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

STSMACOM-827 #1466

wants to merge 2 commits into from

Conversation

JohnC-80
Copy link
Contributor

@JohnC-80 JohnC-80 commented Apr 2, 2024

As with #1465 , the form library seems to be unnecessary in this form. Nevertheless, migration from redux-form and final-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 from redux-form's field wasn't bad. Similar steps were taken, exposing props to DueDatePickerForm from the vanilla version. UseEffect was also employed to handle changes for the entirety of the state. react-hook-form offers watch 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.

Copy link

github-actions bot commented Apr 2, 2024

Jest Unit Test Statistics

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit de465f2. ± Comparison against base commit e278124.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 2, 2024

BigTest Unit Test Statistics

0 files   -     1  0 suites   - 1   0s ⏱️ -14s
0 tests  - 471  0 ✔️  - 435  0 💤  - 36  0 ±0 
0 runs   - 473  0 ✔️  - 437  0 💤  - 36  0 ±0 

Results for commit de465f2. ± Comparison against base commit e278124.

♻️ This comment has been updated with latest results.

@JohnC-80 JohnC-80 requested a review from zburke April 2, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant