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

refactor: onSubmit handler should have correct type #637

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Conversation

Peeja
Copy link
Member

@Peeja Peeja commented Aug 30, 2024

Because we're using createElement from an old version of AriaKit, TS isn't checking the type of our onSubmit handler. It's not currently broken, but it's not being checked either. This change ensures it's correct, and makes it more correct by satisfying the types and the linter. Notably, an async function should not be a handler directly; instead, a handler should kick off an async function and attach an error handler as required. This satisfies lint rules against leaving promises dangling (apparently) accidentally.

Copy link
Member

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Peeja Peeja merged commit 050c9b8 into main Aug 30, 2024
2 checks passed
@Peeja Peeja deleted the no-async-handler branch August 30, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants