Skip to content

Commit

Permalink
Merge branch 'release/0.8.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
SoHotSoup committed Sep 26, 2016
2 parents 1bf5b7d + 2488498 commit 13623da
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion connectAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ function removeAnimationsFromStyle(style) {
return _.omitBy(style, (value, key) => _.isFunction(value) && _.endsWith(key, ANIMATION_SUFFIX));
}

/**
* This function transfers styles that are created by animated interpolations
* and it does that recursively because sometimes style is an object/array
* which contains styles created by animated interpolations
*/
function transferAnimatedValues(styleValue, animatedStyleValue, key) {
if(_.isFunction(animatedStyleValue.interpolate) || _.isUndefined(styleValue)) {
return animatedStyleValue;
}
}

function resolveAnimatedStyle({
props,
Expand Down Expand Up @@ -52,7 +62,7 @@ function resolveAnimatedStyle({

const animatedStyle = createAnimatedStyle(driver, { layout, animationOptions });

return _.assign(removeAnimationsFromStyle(style), animatedStyle);
return _.mergeWith(removeAnimationsFromStyle(style), animatedStyle, transferAnimatedValues);
}

/**
Expand Down

0 comments on commit 13623da

Please # to comment.