Skip to content

Commit

Permalink
Update typescript.md
Browse files Browse the repository at this point in the history
If this isn't done then the types won't be found, if `types` is already set.  Per author @Methuselah96: DefinitelyTyped/DefinitelyTyped#49914 (comment)
  • Loading branch information
lukewlms committed Feb 16, 2021
1 parent cbd4ff0 commit 592f66a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sections/api/typescript.md
Expand Up @@ -10,6 +10,12 @@ npm install @types/styled-components
npm install @types/styled-components @types/styled-components-react-native
```

React Native only: If your `tsconfig` assigns `types` then you will need to add "styled-components-react-native" there. For example:

```json
"types": ["jest", "styled-components-react-native"],
```

> Now that Babel 7 is out and the [TypeScript preset](https://babeljs.io/docs/en/babel-preset-typescript) is available, it's now possible to use the [styled-components babel plugin](/docs/tooling#babel-plugin) in conjunction with TypeScript.
Before you can effectively start to use TypeScript you will have to do a little bit of configuration.
Expand Down

0 comments on commit 592f66a

Please sign in to comment.