Closed simlrh closed 6 years ago
This affects #30.
import styled from 'styled-components'; function getPadding() { return '1rem'; } const Div = styled.div.attrs({ padding: '1rem', })` margin: 0; padding: ${(props) => props.padding}; `; const P = styled.p.attrs({ padding: getPadding(), })` margin: 0; padding: ${(props) => props.padding}; `;
Attempting to use dynamic prop generation fails if you use parentheses inside the attrs constructor. Here Div works but P doesn't.
Div
P
Thanks @simlrh for this issue. I will look into it, when I find the time.
Should be fixed, when #30 is merged (ETA: Beginning of next week.)
This affects #30.
Attempting to use dynamic prop generation fails if you use parentheses inside the attrs constructor. Here
Div
works butP
doesn't.