-
Notifications
You must be signed in to change notification settings - Fork 188
feat!: refactor field component API #1713
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
Conversation
🦋 Changeset detectedLatest commit: e54aaa9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: +1.16 kB (0%) Total Size: 297 kB
ℹ️ View Unchanged
|
@@ -8,5 +8,6 @@ | |||
// TODO: re-enable this rules | |||
"react/display-name": "off", | |||
"@typescript-eslint/no-explicit-any": "warn", | |||
"import/export": "off", |
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.
Why did you add this?
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.
typescript manages this for us, and there were weird errors where eslint thought there was an issue with dual exports but it wasn't an issue since we use TS namespacing 🤔
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.
Great work as always
I saw there are part of code repeated in some input fields
const hasError = Boolean(error) || hasErrorProp;
const id = field.id ?? idProp;
const required = field.required || requiredProp;
let ariaDescription: string | undefined;
if (error) {
ariaDescription = `${id}-error`;
} else if (field.hint) {
ariaDescription = `${id}-hint`;
}
but to be honest I can find a better way to do it.
Yeah I agree, I'll keep it mind when working on other bits, it might be that the API could be made better again 🤔 |
What does it do?
Related issue(s)/PR(s)