Skip to content

Commit f38a83d

Browse files
authored
Merge pull request #46 from cssinjs/feature/fix-component-classes
Fix React Component classes
2 parents 02120dd + 90e8604 commit f38a83d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/styled.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ const styled = ({element, ownStyle, mountSheet, jss}: StyledArgs) => {
129129
// $FlowIgnore
130130
StyledElement.valueOf = () => {
131131
if (!staticClassName) {
132-
staticClassName = `.${jss.generateClassName({
132+
staticClassName = `${jss.generateClassName({
133133
key: generateTagName('static')
134134
})}`
135135
}
136136

137-
return staticClassName
137+
return `.${staticClassName}`
138138
}
139139

140140
// $FlowIgnore

src/tests/__snapshots__/functional.spec.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ exports[`functional tests should use Styled Component classname in string 1`] =
168168
>
169169
<StyledElement>
170170
<div
171-
className=".static-2-id div-1-id"
171+
className="static-2-id div-1-id"
172172
>
173173
name
174174
</div>
@@ -177,7 +177,7 @@ exports[`functional tests should use Styled Component classname in string 1`] =
177177
width={30}
178178
>
179179
<img
180-
className=".static-3-id img-5-id"
180+
className="static-3-id img-5-id"
181181
width={30}
182182
/>
183183
</StyledElement>

0 commit comments

Comments
 (0)