From ed3f7bcc13ce7725edcdc8fcc216378488cd5fd6 Mon Sep 17 00:00:00 2001 From: Peter Byun/FE_MnF <107391698+peter-byun@users.noreply.github.com> Date: Thu, 4 Apr 2024 12:15:07 +0900 Subject: [PATCH] docs: update the css-prop installation guide for users using v6 (#960) * 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 --- sections/api/primary/css-prop.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sections/api/primary/css-prop.mdx b/sections/api/primary/css-prop.mdx index 6175534b..78c92cc5 100644 --- a/sections/api/primary/css-prop.mdx +++ b/sections/api/primary/css-prop.mdx @@ -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 + } +} +```