Skip to content

Commit e2a2472

Browse files
committed
Merge pull request #2194 from ide/animation-docs
[Docs] Remove sections on AnimationExperimental and Pop
2 parents 5222be0 + 4a93d23 commit e2a2472

1 file changed

Lines changed: 0 additions & 76 deletions

File tree

docs/Animations.md

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -556,79 +556,3 @@ var CustomSceneConfig = Object.assign({}, BaseConfig, {
556556
557557
For further information about customizing scene transitions, [read the
558558
source](https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js).
559-
560-
### AnimationExperimental *(Deprecated)*
561-
562-
As the name would suggest, this was only ever an experimental API and it
563-
is **not recommended to use this on your apps**. It has some rough edges
564-
and is not under active development. It is built on top of CoreAnimation
565-
explicit animations.
566-
567-
If you choose to use it anyways, here is what you need to know:
568-
569-
- You will need to include `RCTAnimationExperimental.xcodeproj` and add
570-
`libRCTAnimationExperimental.a` to `Build Phases`.
571-
- Suited only for static "fire and forget" animations - not continuous gestures.
572-
- Hit detection will not work as expected because animations occur on
573-
the presentation layer.
574-
575-
```javascript
576-
var AnimationExperimental = require('AnimationExperimental');
577-
578-
var App = React.createClass({
579-
componentDidMount() {
580-
AnimationExperimental.startAnimation(
581-
{
582-
node: this._box,
583-
duration: 1000,
584-
easing: 'easeInOutBack',
585-
property: 'scaleXY',
586-
toValue: { x: 1, y: 1 },
587-
},
588-
);
589-
},
590-
591-
render() {
592-
return (
593-
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
594-
<View ref={component => this._box = component}
595-
style={{width: 200, height: 200, backgroundColor: 'red'}} />
596-
</View>
597-
)
598-
},
599-
});
600-
```
601-
![](/react-native/img/AnimationExperimentalScaleXY.gif)
602-
603-
Now to demonstrate a known issue, and one of the reasons why it is
604-
recommended not to use `AnimationExperimental` currently, let's try to
605-
animate `opacity` from 1 to 0.5:
606-
607-
```javascript
608-
AnimationExperimental.startAnimation(
609-
{
610-
node: this._box,
611-
duration: 1000,
612-
easing: 'easeInOutBack',
613-
property: 'opacity',
614-
fromValue: 1,
615-
toValue: 0.5,
616-
},
617-
);
618-
```
619-
620-
![](/react-native/img/AnimationExperimentalOpacity.gif)
621-
622-
### Pop *(Unsupported, not recommended)*
623-
624-
[Facebook Pop](https://github.com/facebook/pop) "supports spring and
625-
decay dynamic animations, making it useful for building realistic,
626-
physics-based interactions."
627-
628-
This is not officially supported or recommended because the direction is
629-
to move towards JavaScript-driven animations, but if you must use it,
630-
you can find the code to integrate with React Native
631-
[here](https://github.com/facebook/react-native/issues/1365#issuecomment-104792251).
632-
Please do not open questions specific to Pop on the React Native issues,
633-
StackOverflow is a better place to answer those questions as it is not
634-
considered to be part of the core.

0 commit comments

Comments
 (0)