Skip to content

Commit

Permalink
Merge 74bf67c into 782f454
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Jul 7, 2019
2 parents 782f454 + 74bf67c commit 7786f7f
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions compat/src/index.js
Expand Up @@ -129,7 +129,15 @@ let Children = {
function createElement(...args) {
let vnode = h(...args);

vnode.$$typeof = REACT_ELEMENT_TYPE;

applyEventNormalization(vnode);
let type = vnode.type, props = vnode.props;
if (type && type._forwarded && vnode.ref) {
vnode.props.ref = vnode.ref;
vnode.ref = null;
}

if (typeof type!='function') {
if (props.defaultValue) {
if (!props.value && props.value!==0) {
Expand Down Expand Up @@ -342,20 +350,6 @@ function forwardRef(fn) {
return Forwarded;
}

let oldVNodeHook = options.vnode;
options.vnode = vnode => {
vnode.$$typeof = REACT_ELEMENT_TYPE;

applyEventNormalization(vnode);
let type = vnode.type;
if (type && type._forwarded && vnode.ref) {
vnode.props.ref = vnode.ref;
vnode.ref = null;
}
/* istanbul ignore next */
if (oldVNodeHook) oldVNodeHook(vnode);
};

/**
* Deprecated way to control batched rendering inside the reconciler, but we
* already schedule in batches inside our rendering code
Expand Down

0 comments on commit 7786f7f

Please sign in to comment.