To use styled-components
+ FlatList
, we have to write like this:
interface User {
id: number
name: string
}
const StyledFlatList = styled(FlatList as new () => FlatList<User>)`
background-color: #f7f7f7;
`
[edited]
Finally, I added my workaround. I hope someone solve the issue.
https://github.com/styled-components/styled-components/issues/1803#issuecomment-497323287
[/edited]
This is because styled.FlatList does not support by typing definition of styled-components.
see: https://github.com/styled-components/styled-components/issues/1294
Ref: https://github.com/styled-components/styled-components/issues/1803#issuecomment-407332173
Latest comments (13)
Nice! Still working...
Thank you my friend!
thanks!
Thanks for your comment!
Thank you! It helped me so much!
Thanks for your comment!
Thank you bro, you help me a lot!
Thanks for your comment!
Thank you so much! I was already getting angry for not being able to put the types correctly 😅
Thank you for your feedback :)
Thank you so much! This solution works on @emotion/native with this type definition as well!!
Thanks for the information!
Thank you very much. I'm just stuck on this.