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

Clean up Formik Usage #551

Open
steets250 opened this issue Mar 14, 2022 · 0 comments
Open

Clean up Formik Usage #551

steets250 opened this issue Mar 14, 2022 · 0 comments
Labels
Redesign Issues being saved for the portal redesign

Comments

@steets250
Copy link
Member

Some older form components make use of a container that encompasses a component using the withFormik hook, and ends up splitting a form into multiple components (the actual form, and then the wired up version). I believe it's cleaner and more concise to make use of the <Formik> element to wrap the form and provide inline methods, rather than having to pass everything as props.

This is an example of the withFormik:
Component: https://github.com/acmucsd/membership-portal-ui/blob/master/src/auth/components/SignInForm/index.tsx
Container: https://github.com/acmucsd/membership-portal-ui/blob/master/src/auth/containers/SignInForm.tsx

And this is an example of <Formik>:
https://github.com/acmucsd/membership-portal-ui/blob/master/src/store/components/AdminCollectionPage/index.tsx

@steets250 steets250 added the Redesign Issues being saved for the portal redesign label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Redesign Issues being saved for the portal redesign
Projects
None yet
Development

No branches or pull requests

1 participant