TypeScript types for styled-components that focus more on type checking quickly instead of complete like @types/styled-components
So far they only suport React Native, in the meanwhile check out this gist for React.
Make sure you don't have @types/styled-components
or @types/styled-components-react-native
installed.
npm r @types/styled-components @types/styled-components-react-native
Then install the alternative typings:
npm i faster-styled-components-types
Since our types arer not prefixed with @types
, you then need to
go to your tsconfig.json
and change typeRoots
to this:
{
"compilerOptions": {
"typeRoots": ["./node_modules/@types/", "./node_modules/faster-styled-components-types/"]
}
}