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

fix typing on useArgs #20610

Merged
merged 9 commits into from
Jan 13, 2023
Merged

fix typing on useArgs #20610

merged 9 commits into from
Jan 13, 2023

Conversation

ndelangen
Copy link
Member

Original PR: #18122 by @annacc-everlaw
Issue: useArgs is typed incorrectly.

What I did

Fixed useArgs to take a type parameter, P, which should be the type of the args for your story. By default, it's set to Args so that it's backwards compatible. Additionally, fixed the resetArgs function to be a (string[]) => void rather than a ([string]) => void, as a [string] makes no sense in this context (and is incorrect).

How to test

This is just a type change, so this can be tested by ensuring that things are typed correctly in your story when using useArgs<YourStoryArgType>.

@ndelangen ndelangen merged commit 710d668 into next Jan 13, 2023
@ndelangen ndelangen deleted the fix-use-args-types branch January 13, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants