How can I pass in an argument into Styled Components?
What I tried was to create an interface and a styled component:
export interface StyledContainerProps { topValue?: number; } export const StyledContainer: StyledComponentClass<StyledContainerProps> = styled.div` position: absolute; top: `${props.topValue || 0}px`; `; Then I want to use it like this:
<StyledContainer topValue={123} > This has a distance of 123px to the top </StyledContainer> But it's saying that props doesn't have the attribute topValue.