Skip to content

Commit 7ed668e

Browse files
committed
Add support for managing className VS class
1 parent e1d7f47 commit 7ed668e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export default function renderToString(vnode) {
4242
for (let name in attributes) {
4343
if (HOP.call(attributes, name)) {
4444
let v = attributes[name];
45+
if (name==='className') {
46+
if (attributes['class']) continue;
47+
name = 'class';
48+
}
4549
if (v!==null && v!==undefined) {
4650
s += ` ${name}="${escape(v)}"`;
4751
}

0 commit comments

Comments
 (0)