From 65ff8a445515f5a57b7ecf720d516759192e7702 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Wed, 11 Nov 2015 11:15:11 +0800 Subject: [PATCH] remove precomputeStyle remove precomputeStyle --- docs/Animations.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/Animations.md b/docs/Animations.md index 346c90363e3..a18f0f78ce6 100644 --- a/docs/Animations.md +++ b/docs/Animations.md @@ -473,16 +473,13 @@ might be helpful if the component that we are updating is deeply nested and hasn't been optimized with `shouldComponentUpdate`. ```javascript -// Outside of our React component -var precomputeStyle = require('precomputeStyle'); - // Back inside of the App component, replace the scrollSpring listener // in componentWillMount with this: this._scrollSpring.addListener({ onSpringUpdate: () => { if (!this._photo) { return } var v = this._scrollSpring.getCurrentValue(); - var newProps = precomputeStyle({transform: [{scaleX: v}, {scaleY: v}]}); + var newProps = {style: {transform: [{scaleX: v}, {scaleY: v}]}}; this._photo.setNativeProps(newProps); }, });