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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic type parameter for setStatus value #2153

Open
reverie opened this issue Dec 28, 2019 · 3 comments 路 May be fixed by #2323
Open

Generic type parameter for setStatus value #2153

reverie opened this issue Dec 28, 2019 · 3 comments 路 May be fixed by #2323

Comments

@reverie
Copy link

reverie commented Dec 28, 2019

馃殌 Feature request

Current Behavior

setStatus(...), status, and initialStatus are all typed as any. This prevents any typechecking on these values.

Desired Behavior

Type checking is available to ensure correctness of setStatus arguments, validate status case handling, etc.

Suggested Solution

Add a generic type parameter to Formik, after Values, that is the type of all valid status states.

Who does this impact? Who is this for?

All typescript users using status.

@jaredpalmer
Copy link
Owner

Yeah this is a good idea. Feel free to submit PR

@doniyor2109 doniyor2109 linked a pull request Feb 27, 2020 that will close this issue
@stale stale bot added the stale label Mar 6, 2020
@jkillian
Copy link

jkillian commented Apr 14, 2020

Just ran into this myself, would be great to see it get in! Thanks for making a PR @reverie, I was about to start working on one myself if I hadn't stumbled across yours.

Edit, thanks @doniyor2019! Wrong credit the first time 馃槃

@reverie
Copy link
Author

reverie commented Apr 15, 2020

Just ran into this myself, would be great to see it get in! Thanks for making a PR @reverie, I was about to start working on one myself if I hadn't stumbled across yours

It wasn't me鈥攖hank @doniyor2109!

@stale stale bot added the stale label Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants