Skip to content

Commit ce10c7c

Browse files
committed
Do not manipulate properties when appendClassName is undefined.
1 parent bda6c84 commit ce10c7c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/linkClass.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ linkElement = (element, styles, configuration) => {
4141
if (styleNames.length) {
4242
appendClassName = generateAppendClassName(styles, styleNames, configuration.errorWhenNotFound);
4343

44-
if (elementShallowCopy.props.className) {
45-
appendClassName = elementShallowCopy.props.className + ' ' + appendClassName;
46-
}
44+
if (appendClassName) {
45+
if (elementShallowCopy.props.className) {
46+
appendClassName = elementShallowCopy.props.className + ' ' + appendClassName;
47+
}
4748

48-
elementShallowCopy.props.className = appendClassName;
49-
elementShallowCopy.props.styleName = null;
49+
elementShallowCopy.props.className = appendClassName;
50+
elementShallowCopy.props.styleName = null;
51+
}
5052
}
5153

5254
if (elementIsFrozen) {

0 commit comments

Comments
 (0)