diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index 761c48a104..7007a3d829 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -440,21 +440,21 @@ export class StyleSheetManager extends React.Component< * The CSS prop is not declared by default in the types as it would cause 'css' to be present * on the types of anything that uses styled-components indirectly, even if they do not use the * babel plugin. - * + * * You can load a default declaration by using writing this special import from * a typescript file. This module does not exist in reality, which is why the {} is important: - * + * * ```ts * import {} from 'styled-components/cssprop' * ``` - * + * * Or you can declare your own module augmentation, which allows you to specify the type of Theme: - * + * * ```ts * import { CSSProp } from 'styled-components' * * interface MyTheme {} - * + * * declare module 'react' { * interface Attributes { * css?: CSSProp diff --git a/types/styled-components/test/index.tsx b/types/styled-components/test/index.tsx index 43f0f68607..6e8715730e 100644 --- a/types/styled-components/test/index.tsx +++ b/types/styled-components/test/index.tsx @@ -783,15 +783,16 @@ function cssProp() { return
; } - const myCss = 'background: blue;'; + const myCss = "background: blue;"; return ( <>
-
+ {/* + For some reason $ExpectError doesn't work on this expression. + Only strings work, objects crash the plugin. +
+ */}
-