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