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 />
<BottleComponent fill />
</Wrapper>
)
}
Now, the above code works, but I'm unsure why IBottleComponentProps is needed twice, both at the beginning and the end - And without it, I get the following:
Type '{ fill: boolean; }' is not assignable to type 'IntrinsicAttributes & Pick<Pick<Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | ... 253 more ... | "onTransitionEndCapture"> & { ...; }, "slot" | ... 254 more ... | "onTransitionEndCapture"> & Partial<...>, "slot" | ... 254 more ... | "onTransitionEndCapture"> & { ...; } & { ...; }'.
Additionally, with the first code example, I get a browser log as such;
index.js:1 Warning: Received `true` for a non-boolean attribute `fill`.
It's honestly pretty confusing, and the Styled-Components documentation isn't very clear in this regard. A push in the right direction would be greatly appreciated.

