Skip to content

Commit

Permalink
docs: update the css-prop installation guide for users using v6 (#960)
Browse files Browse the repository at this point in the history
* docs: update the css-prop installation guide for users using v6

* docs: update the css-prop installation guide for users using v6
Co-authored-by: Jonghyeon Ko jonghyeon.ko@wesang.com

---------

Co-authored-by: Jonghyeon Ko <jonghyeon.ko@wesang.com>
  • Loading branch information
peter-byun and manudeli committed Apr 4, 2024
1 parent 13abba1 commit ed3f7bc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sections/api/primary/css-prop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,19 @@ To prevent TypeScript errors on the `css` prop on arbitrary elements, install `@
```ts
import {} from 'styled-components/cssprop'
```

See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31245#issuecomment-446011384 for more information.

If you're using a higher version than v6, you do not need to install `@types/styled-components`.
Instead, you can directly import the `CSSProp` in your project like this:

```ts
import {} from 'react'
import type { CSSProp } from 'styled-components'

declare module 'react' {
interface Attributes {
css?: CSSProp | undefined
}
}
```

0 comments on commit ed3f7bc

Please sign in to comment.