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

useFormState has painful typescript return type #476

Closed
stramel opened this issue May 15, 2019 · 3 comments · Fixed by #482
Closed

useFormState has painful typescript return type #476

stramel opened this issue May 15, 2019 · 3 comments · Fixed by #482

Comments

@stramel
Copy link

stramel commented May 15, 2019

Are you submitting a bug report or a feature request?

What is the current behavior?

To be able to destructure props out of useFormState I must cast it as FormState since the existing can be void | FormState.

What is the expected behavior?

I should not have to cast it as FormState.
const { submitError, submitFailed, submitting } = useFormState() should work.

Sandbox Link

What's your environment?

react-final-form v5.0.2

Other information

@Andarist
Copy link
Contributor

I've prepared a fix for this in #482

@erikras
Copy link
Member

erikras commented May 24, 2019

Published fix in v5.1.1.

@lock
Copy link

lock bot commented Jun 24, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants