-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stronger type safety for createRestyleFunction (#21)
* Improve type-safety by using generics * Improve TypeSafety of useRestyle hook This ensures that the output props from useRestyle are actually typed properly instead of casting them to `any` * Cleanup / improve typings of useRestyle and RestyleFunction * Strong type safety for createRestyleFunction 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. * Fix type error in createRestyleFunction.test.ts
- Loading branch information
1 parent
b7d40d4
commit ad59d33
Showing
8 changed files
with
69 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const getKeys = <T>(object: T) => Object.keys(object) as (keyof T)[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters