Skip to content

Commit

Permalink
Remove built-in serialization of Object class / className values,…
Browse files Browse the repository at this point in the history
… which was limited compared to npm.im/classnames and prevented third party CSS mechanisms from working. Fixes #401.
  • Loading branch information
developit committed Apr 4, 2017
1 parent 73947d6 commit b2c85e3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
4 changes: 0 additions & 4 deletions src/dom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ export function removeNode(node) {
* @private
*/
export function setAccessor(node, name, old, value, isSvg) {

if (name==='className') name = 'class';

if (name==='class' && value && typeof value==='object') {
value = hashToClassName(value);
}

if (name==='key') {
// ignore
Expand Down
13 changes: 0 additions & 13 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ export function isString(obj) {
}


/** Convert a hashmap of CSS classes to a space-delimited className string
* @private
*/
export function hashToClassName(c) {
let str = '';
for (let prop in c) {
if (c[prop]) {
if (str) str += ' ';
str += prop;
}
}
return str;
}


/** Just a memoized String#toLowerCase */
Expand Down

0 comments on commit b2c85e3

Please sign in to comment.