-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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: refactor the button component using forwardRef
#4379
base: main
Are you sure you want to change the base?
Conversation
After this submission merge, all events related to Form submission can be triggered using HTML instead of using JavaScript methods. |
@TinsFox Hello there is a conflict in this pr. |
@crazywoola All conflicts have been resolved. |
}, | ||
}, | ||
defaultVariants: { | ||
variant: 'primary', |
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.
variant: 'primary', | |
variant: 'default', |
default variant should be 'default'
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.
ths!
@TinsFox app/components/tools/add-tool-modal/index.tsx |
Description
refactor the button component using
forwardRef
The previous button component was disguised as a div, which would lose the original capabilities of HTML, such as form submission. This will prevent users from submitting when JavaScript capabilities are turned off. But when we follow web standards, we can bring a better experience
This submission includes three contents:
type
attribute tovariant
. Type is the original attribute of button. We should not modify it.memo
. As a basic component, memo is not requiredFixes # (issue)
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
All button components should behave the same as before
Suggested Checklist:
dev/reformat
(backend) andcd web && npx lint-staged
(frontend) to appease the lint gods