Adding documentation to useNativeDriver portion of the Animated API
Summary: What existing problem does the pull request solve? Ensure users of the React Native platform are aware of transform properties they must have while using `useNativeDriver` with the Animated API. Not applicable. I've been messing around with this for a couple of days at this point and feel a bit silly. See this issue [here](https://github.com/facebook/react-native/issues/13522). This would have saved me some time and will likely save others time as well. Thank you for taking the time to look over this PR. Cheers! Closes https://github.com/facebook/react-native/pull/13524 Differential Revision: D5567584 Pulled By: hramos fbshipit-source-id: 4be9f1ba0f21148106f596efb0be791d4d364a66
This commit is contained in:
parent
23f72a9eb9
commit
6bcc56e251
|
@ -360,6 +360,23 @@ things like `transform` and `opacity` will work, but flexbox and position proper
|
|||
When using `Animated.event`, it will only work with direct events and not bubbling events.
|
||||
This means it does not work with `PanResponder` but does work with things like `ScrollView#onScroll`.
|
||||
|
||||
### Bear in mind
|
||||
|
||||
While using transform styles such as `rotateY`, `rotateX`, and others ensure the transform style `perspective` is in place.
|
||||
At this time some animations may not render on Android without it. Example below.
|
||||
|
||||
```javascript
|
||||
<Animated.View
|
||||
style={{
|
||||
transform: [
|
||||
{ scale: this.state.scale },
|
||||
{ rotateY: this.state.rotateY },
|
||||
{ perspective: 1000 } // without this line this Animation will not render on Android while working fine on iOS
|
||||
]
|
||||
}}
|
||||
/>
|
||||
```
|
||||
|
||||
### Additional examples
|
||||
|
||||
The RNTester app has various examples of `Animated` in use:
|
||||
|
|
Loading…
Reference in New Issue