-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Typescript: styleName usage with @types/react@^17 #292
Comments
add file to your project, named react-css-module.d.ts. declare namespace React {
interface Attributes {
styleName?: string | undefined;
}
interface HTMLAttributes<T> {
styleName?: string | undefined;
}
interface SVGAttributes<T> {
styleName?: string | undefined;
}
} |
I have the same issue with "@types/react-css-modules": "^4.6.4", |
@yinsang your solution doesn't work with Maybe you have some thoughts how to fix that |
This works for me([email protected]) // global.d.ts
declare namespace JSX {
interface IntrinsicAttributes {
styleName?: string;
}
}
declare namespace React {
interface Attributes {
styleName?: string;
}
interface HTMLAttributes<T> {
styleName?: string;
}
interface SVGAttributes<T> {
styleName?: string;
}
}
"react/no-unknown-property": "off" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's a problem with extending
Attributes
andHTMLAttributes
interface withstyleName
with@types/react@^17
. It simply has no effect:"@types/react-css-modules": "^4.6.2",
The text was updated successfully, but these errors were encountered: