[v4.0.0] Types: Could not find a declaration file for module 'styled-components/native'.
See original GitHub issuethere are no types for react-native components
Environment
npx: Installierte 1 in 2.983s
System:
- OS: macOS High Sierra 10.13.6
- CPU: x64 Intel® Core™ i5-6267U CPU @ 2.90GHz
- Memory: 751.21 MB / 16.00 GB
- Shell: 5.3 - /bin/zsh
Binaries:
- Node: 10.9.0 - /usr/local/bin/node
- Yarn: 1.10.1 - /usr/local/bin/yarn
- npm: 5.10.0 - /usr/local/bin/npm
- Watchman: 4.9.0 - /usr/local/bin/watchman
Reproduction
add typescript and tslint
Steps to reproduce
let tslint your code
Expected Behavior
no error
Actual Behavior
$ tslint --project tsconfig.json && yarn typecheck
$ tsc --noEmit
App.tsx(5,20): error TS7016: Could not find a declaration file for module 'styled-components/native'. '…/app/node_modules/styled-components/native/dist/styled-components.native.cjs.js' implicitly has an 'any' type.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:41 (3 by maintainers)
Top Results From Across the Web
Could not find a declaration file for module 'styled-components ...
If you try to do this in a React Native TypeScript project, you'll run into the following typings error: Could not find a...
Read more >Could not find declaration file for 'styled-components'
The error "could not find declaration file for module 'styled-components'" occurs when TypeScript cannot find the type declaration for a ...
Read more >types/styled-components - npm
Start using @types/styled-components in your project by running `npm i ... indicating that this package has built-in type declarations.
Read more >could not find a declaration file of 'styled components" in nextjs
native.cjs.js' implicitly has an 'any' type. ... Could not find a declaration file for module 'react-beautiful-dnd'. '/Users/mohitharshan/Desktop/scramble/ ...
Read more >Releases - styled-components
theme'; type ThemeType = typeof Theme; declare module 'styled-components' { export ... Update css-to-react-native to v3.0.0 (#2811); the one breaking change ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
styled-components/native
types moved to@types/styled-components-react-native
.Just add:
❯yarn add @types/styled-components-react-native -D