Styled Components .attrs w/ TypeScript
问题 I'm a little confused on how to use the .attrs() function with TypeScript. Say I have the following: BottleBar.tsx: interface IBottleComponentProps { fill?: boolean } const BottleComponent = styled.div.attrs<IBottleComponentProps>(({fill}) => ({ style: { backgroundImage: `url("./media/images/${fill ? 'Bottle-Filled.png' : 'Bottle-Empty.png'")` } }))<IBottleComponentProps` width: 20px; height: 20px; `; export default function BottleBar() { return ( <Wrapper> <BottleComponent />