Skip to content

Commit

Permalink
Simplify className compat (-5 B)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Nov 12, 2019
1 parent 42739b3 commit 0a13dfe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions compat/src/index.js
Expand Up @@ -411,11 +411,10 @@ options.vnode = vnode => {
}

// Alias `class` prop to `className` if available
let a = vnode.props;
if (a.class || a.className) {
classNameDescriptor.enumerable = 'className' in a;
if (a.className) a.class = a.className;
Object.defineProperty(a, 'className', classNameDescriptor);
if (props.class || props.className) {
classNameDescriptor.enumerable = 'className' in props;
if (props.className) props.class = props.className;
Object.defineProperty(props, 'className', classNameDescriptor);
}

// Events
Expand Down

0 comments on commit 0a13dfe

Please sign in to comment.