You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
➜ StyledTSTest git:(master) tsc --version
Version 4.5.4
Steps to reproduce
npx react-native init StyledTSTest --template react-native-template-typescript
cd StyledTSTest
npm i --save styled-components
npm i --save-dev @types/styled-components-react-native
npm i --save-dev @types/styled-components
tsc --noEmit
App.tsx:30:20 - error TS7016: Could not find a declaration file for module 'styled-components/native'. '/Users/andrew/code/js/rn/StyledTSTest/node_modules/styled-components/native/dist/styled-components.native.cjs.js' implicitly has an 'any' type.
30 import styled from 'styled-components/native';~~~~~~~~~~~~~~~~~~~~~~~~~~
Expected Behavior
no TS error
Actual Behavior
TS error:
App.tsx:30:20 - error TS7016: Could not find a declaration file for module 'styled-components/native'. '/Users/andrew/code/js/rn/StyledTSTest/node_modules/styled-components/native/dist/styled-components.native.cjs.js' implicitly has an 'any' type.
30 import styled from 'styled-components/native';~~~~~~~~~~~~~~~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered:
I am seeing the TS fail for
styled-components/native
import for React Native again.I was previously helped by #2099 - but it appears a new release somewhere may have broken the fixes in @types/styled-components-react-native ?
I've managed to reproduce with a totally fresh / empty RN project (steps to create below): https://github.com/andrewrt/StyledTSTest
Environment
Also:
Steps to reproduce
npx react-native init StyledTSTest --template react-native-template-typescript cd StyledTSTest npm i --save styled-components npm i --save-dev @types/styled-components-react-native npm i --save-dev @types/styled-components
add to App.tsx:
run and get
Expected Behavior
no TS error
Actual Behavior
TS error:
The text was updated successfully, but these errors were encountered: