-
Notifications
You must be signed in to change notification settings - Fork 82
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
refactor(form-controls): use functional components and react hooks #641
Conversation
packages/forma-36-react-components/src/components/TextField/TextField.tsx
Show resolved
Hide resolved
Deploy preview for forma-36-react-components ready! Built with commit a41cdca https://deploy-preview-641--forma-36-react-components.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! Thanks a lot @mshaaban0
packages/forma-36-react-components/src/components/Textarea/Textarea.tsx
Outdated
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/ControlledInput/ControlledInput.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the extensive work ❤️ I've added a few questions and thoughts. The biggest thing is that I think we should make sure to wrap event handlers in useCallback
for good measure.
packages/forma-36-react-components/src/components/ControlledInput/ControlledInput.tsx
Outdated
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/ControlledInputField/ControlledInputField.tsx
Outdated
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/Form/Form.tsx
Outdated
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/Form/Form.tsx
Outdated
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/Select/Select.tsx
Outdated
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/Select/Select.tsx
Outdated
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/SelectField/SelectField.tsx
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/SelectField/SelectField.tsx
Outdated
Show resolved
Hide resolved
packages/forma-36-react-components/src/components/TextField/TextField.tsx
Outdated
Show resolved
Hide resolved
783e2c0
to
c264b46
Compare
@denkristoffer Thanks for all the useful comments, addressed 👍 |
packages/forma-36-react-components/src/components/ControlledInput/ControlledInput.tsx
Outdated
Show resolved
Hide resolved
Great! |
22b81a1
to
60c2800
Compare
60c2800
to
8d49f55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! 🎉
Purpose of PR
Refactor form controls to use functional components and react hooks, why:
UNSAFE
lifecycle methodsNote: This shouldn't introduce any breaking changes, so if you see anything please flag it.
PR Checklist
readme.md
file(s)