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

Stronger type safety for createRestyleFunction #21

Merged

Conversation

META-DREAMER
Copy link
Contributor

Improve the typings of createRestyleFunction, e.g. the prop value in transform will be strongly typed/inferred.

Also added some other improvements, like removing the need for explicit return value on useRestyle that was actually
throwing away the "style" prop in the returned type. This was done by properly typing filterRestyleProps so everything
could be inferred.

This ensures that the output props from useRestyle are actually typed properly instead of casting them to `any`
Improve the typings of createRestyleFunction, e.g. the prop value in transform will be strongly typed/inferred.

Also added some other improvements, like removing the need for explicit return value on useRestyle that was actually
throwing away the "style" prop in the returned type. This was done by properly typing filterRestyleProps so everything
could be inferred.
@JoelBesada
Copy link
Contributor

Great work, no comments here :)

@JoelBesada JoelBesada merged commit ad59d33 into Shopify:master Jul 22, 2020
JoelBesada added a commit that referenced this pull request Jul 22, 2020
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