No style typings when using `styled(Animated.View)` in React Native and Emotion 11
See original GitHub issueCurrent behavior:
When I use styled(Animated.View)({ ... })
my style object seem to have the any
type, instead of ViewStyle
.
To reproduce:
- Create a styled animated component like described above.
- See that the styles have no type (no autocompletion in VSCode) 😃
Expected behavior:
Style object should be of type ViewStyle
.
Environment information:
react
version: 16.11.0emotion
version: ^11.0.0-next.14
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Using styled components with Typescript, prop does not exist?
The styled component will have to specify the prop to pass to the component like styled("h2")<IProps> . You can read more about the...
Read more >FAQs - styled-components
In a React Native project using TypeScript, it is because you need to add @types/styled-components-react-native.
Read more >Styled Components - Emotion
styled is a way to create React components that have styles attached to them. It's available from @emotion/styled. styled was heavily inspired by ......
Read more >Animated - React Native
By using the native driver, we send everything about the animation to native before starting the animation, allowing native code to perform the ......
Read more >How to style React Router links with styled-components
One helpful solution to this challenge is a CSS-in-JS library called styled-components. This tool allows us to construct and manage our styles ...
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
Let’s close it then and pretend that nothing has happened 😉
@Andarist This somehow works now 😄 I have
"@types/react-native": "^0.63.35"
and"typescript": "^4.0.5"