amlan-roy / resume-craft

Resume Craft: Your go-to platform for effortlessly tailoring ATS-friendly resumes to job descriptions. Streamline your job application process and stand out in the competitive market.
https://resume-craft-ten.vercel.app
7 stars 3 forks source link

Update DurationInput component to be uncontrolled #12

Closed amlan-roy closed 8 months ago

amlan-roy commented 8 months ago

Describe the issue in detail The form components of shadcn library are controlled components using react-hook-forms, and are good when used directly inside the form.

But we want to create reusable components that are going to use these form components, so we want them to be uncontrolled.

This will also make unit/integration testing these components easier.

~The existing components are done. Need to do this for DurationInput component.~ <Refer the below comment for details> Also need to add tests for it.

Describe the solution you'd like We can ditch shadcn's form and use our custom form. In this way, we can ensure that these components are uncontrolled. This can address the above issue.

Are you willing to contribute to this issue? [Yes/No] Yes

amlan-roy commented 8 months ago

Investigated this issue. Apparently we need to keep this as a controlled component because in order for the date picker to work with react-hooks-form. it needs to be a controlled component and use the control from react-hooks-form.

So can not convert this into an uncontrolled component as of current information. Will still need to add tests for the component.