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 stylesheet() function does not enforce NestedCSSProperties as keys on the child objects within the argument. This vastly reduces the usability of the stylesheet() function, as compared to the strict types enforced by style().
This code compiles just fine:
const styles = stylesheet({
item: {
borderLeft: "4px solid transparent",
"this is a not a CSS property": "transparent",
}
});
However, if I remove the borderLeft property, the TS compiler recognizes the invalid key.
TypeScript: 2.8.4
Typestyle: 2.0.1
Node: 8.2.1
The text was updated successfully, but these errors were encountered:
It looks like the issue appears again - the workaround is to explicitly cast the object to a proper type, i.e.
const styles = stylesheet({
item: {
borderLeft: "4px solid transparent",
"this is a not a CSS property": "transparent",
}
} as Record<string, types.NestedCSSProperties>);
The
stylesheet()
function does not enforceNestedCSSProperties
as keys on the child objects within the argument. This vastly reduces the usability of thestylesheet()
function, as compared to the strict types enforced bystyle()
.This code compiles just fine:
However, if I remove the
borderLeft
property, the TS compiler recognizes the invalid key.TypeScript: 2.8.4
Typestyle: 2.0.1
Node: 8.2.1
The text was updated successfully, but these errors were encountered: