compiled icon indicating copy to clipboard operation
compiled copied to clipboard

Destructuring in a style interpolation does not pass valid HTML attributes down to the DOM element

Open pgmanutd opened this issue 4 years ago • 0 comments

Outcome of #403

Right now following works for MemberExpression (Implemented here)

styled.div`
  color: ${props => props.color}; // added to HTML element
  background-color: ${props => props.bgColor}; // NOT added to HTML element
`;

It doesn't work for Identifier as of now which is coming from userland:

styled.div`
  color: ${({ color }) => color}; // should be added to HTML element
  background-color: ${({ bgColor }) => bgColor}; // should NOT be added to HTML element
`;

pgmanutd avatar Dec 15 '20 07:12 pgmanutd