-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
overflowY throws TypeScript error and won't compile #1179
Comments
It is not a problem with
As you can see Possible solutions:
import { jsx, CSSObject } from "@emotion/core";
// ^^^^^^^^^
// and later
const styles: Record<string, CSSObject> = { // you should specify list of keys ( e.g. Record<'tosContainer' | 'otherContainer', CSSObject>) to restore proper suggestions on `styles` object.
tosContainer: {
height: "50vh",
overflowY: "scroll",
overflowX: "wrongScroll" // error here, instead of `css` property on component
}
};
P.S. Looks like there is another similar case with a good description #1129 (comment) P.P.S. (haven't seen that was closed while editing) const styles: CSSObject = {
height: "50vh",
overflowY: "wrongScroll", // Error: Type '"wrongScroll"' is not assignable to type '"clip" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "auto" | "hidden" | "visible" | "scroll" | OverflowXProperty[]'.
"overflow-y": wrongScroll' // No Error
}; |
Thanks @IllusionMH! Learned some new things today. |
emotion
version: ^10.0.5react
version: ^16.7.0Relevant code:
What you did:
Tried to add an overflow-y css style.
What happened:
TypeScript won't compile:
Reproduction:
CRA TypeScript, add the above code in a
.tsx
file.Problem description:
TypeScript won't compile with an overflow-y property. When I looked at the definition it was from Emotion so I figured I'd raise it.
Suggested solution:
For now kebab-case "overflow-y" and it works.
The text was updated successfully, but these errors were encountered: