-
-
Notifications
You must be signed in to change notification settings - Fork 106
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 utility props value type about override the Theme
interface
#345
fix utility props value type about override the Theme
interface
#345
Conversation
e5a42c0
to
78859fa
Compare
78859fa
to
e0942c5
Compare
Theme
interface in typescript
Theme
interface in typescriptTheme
interface
packages/system/src/types.ts
Outdated
@@ -126,7 +126,7 @@ declare type SynthesizedPath<T extends {}> = { | |||
export type ThemeNamespaceValue< | |||
K extends string, | |||
T extends ITheme, | |||
> = SynthesizedPath<T[K]> | |||
> = SynthesizedPath<T[K]> | number | string | false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the fix is correct. ThemeNamespaceValue
means a value in the theme namespace, nothing else. However, I see what you want to fix, but I think it is not the right place to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review.
Sure, my fix wasn't fit for name.
Read the code again and investigate the appropriate corrections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1st, I reverted prev changes, and changed SystemProp insted of ThemeNamespaeceValue
for fix utility props. I think this type name means utility props, but what do you think?
2nd, above changes is not cover same problem about each themeGetter. so I changed ThemeGetter
for it.
3rd, the first change on SystemProps found an issue where col
and row
props didn't support false, so we fixed each one.
This reverts commit 7a430a9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry but it does not make sens at all to authorize anything anywhere. Each prop has its own typing, maybe some are missing, but globally it is good.
thanks for your review.
Indeed, I think it should be safe for Typing to be more accurate and limited. This PR will be closed and I'll reconsider if we can contribute in another way. |
Summary
this PR is fix below issue by add
string | number | false
intoThemeNamespaceValue
(7a430a9).Fixes #344
and fix type-errors about theme value types in tests files.
Test plan
npm install
in project rootnpx tsc --noEmit -p ./packages/system
npx tsc --noEmit -p ./packages/styled-components
npx tsc --noEmit -p ./packages/emotion
npm test
in project root)