Skip to content

Commit 6fcce8d

Browse files
committed
use format
1 parent a394e34 commit 6fcce8d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/styled-components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function TaggedTemplateExpression(path, state) {
3737
function insertBefore(node, id) {
3838
return t.callExpression(t.memberExpression(node, t.identifier('attrs')), [
3939
t.objectExpression([
40-
t.objectProperty(t.StringLiteral(options.attribute), t.StringLiteral(id))
40+
t.objectProperty(t.StringLiteral(options.attribute), t.StringLiteral(options.format(id)))
4141
])
4242
])
4343
}

test/fixtures/react/styled-components/expected.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ const basic = styled.div.attrs({
1010
`;
1111

1212
const withChain = styled.div.attrs({
13-
'data-qa': 'withChain'
13+
'data-qa': 'with-chain'
1414
}).withConfig()`
1515
color: black;
1616
`;
1717

1818
const withInterpolation = styled.div.attrs({
19-
'data-qa': 'withInterpolation'
19+
'data-qa': 'with-interpolation'
2020
})`
2121
color: ${Colors.black};
2222
`;
@@ -28,7 +28,7 @@ const el = styled(El).attrs({
2828
`;
2929

3030
const arrowExpr = () => styled.div.attrs({
31-
'data-qa': 'arrowExpr'
31+
'data-qa': 'arrow-expr'
3232
})`
3333
color: black;
3434
`;

0 commit comments

Comments
 (0)