You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use of NonNullishPartialRecord in ThemeOverride only allows for Records as types, and forces all values of Records to be strings
This means that Records with number (or other) values like fontWeights do not work.
It also means that font, breakpoints and VariantValues (the latter two which should be, but aren't, defined on interface Theme) of types string, array or string literal respectively do not work (because they are not Records).
This can be fixed by adding breakpoints and VariantValues (and maybe other missing?) to the interface Theme, adding the type of the key to NonNullishPartialRecord and the plain type as a type:
Somewhat relatedly, you might also want to reconsider defining objects and exporting their types with typeof, and instead define interfaces for them, ensuring local type safety, but also some pretty cool options like instead of using string type for pixel values, you can do:
typePixels= `${number}px`
I'm willing to give a hand with any and all of this, but I don't want to waste my time if you won't accept those changes :)
The text was updated successfully, but these errors were encountered:
The use of
NonNullishPartialRecord
inThemeOverride
only allows for Records as types, and forces all values of Records to be stringsThis means that Records with number (or other) values like fontWeights do not work.
It also means that font, breakpoints and VariantValues (the latter two which should be, but aren't, defined on interface
Theme
) of types string, array or string literal respectively do not work (because they are not Records).This can be fixed by adding breakpoints and VariantValues (and maybe other missing?) to the interface
Theme
, adding the type of the key toNonNullishPartialRecord
and the plain type as a type:Somewhat relatedly, you might also want to reconsider defining objects and exporting their types with
typeof
, and instead define interfaces for them, ensuring local type safety, but also some pretty cool options like instead of using string type for pixel values, you can do:I'm willing to give a hand with any and all of this, but I don't want to waste my time if you won't accept those changes :)
The text was updated successfully, but these errors were encountered: