mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-21 17:10:30 +08:00
Drive any numerical prop via NativeAnimated
Summary: In theory, we should be able to animate any non-layout property, including custom ones. While there is still work to be done on the native side to fully enable this, we should start by dropping the prop whitelist. Closes https://github.com/facebook/react-native/pull/10658 Differential Revision: D4379031 Pulled By: ericvicenti fbshipit-source-id: fe9c30ea101e93a8b260d7d09a909fafbb82fee6
This commit is contained in:
committed by
Facebook Github Bot
parent
0bfb426877
commit
7e869b9d0a
@@ -30,8 +30,11 @@ const {
|
||||
Animated,
|
||||
StyleSheet,
|
||||
TouchableWithoutFeedback,
|
||||
Slider,
|
||||
} = ReactNative;
|
||||
|
||||
var AnimatedSlider = Animated.createAnimatedComponent(Slider);
|
||||
|
||||
class Tester extends React.Component {
|
||||
state = {
|
||||
native: new Animated.Value(0),
|
||||
@@ -228,7 +231,6 @@ exports.description = 'Test out Native Animations';
|
||||
exports.examples = [
|
||||
{
|
||||
title: 'Multistage With Multiply and rotation',
|
||||
description: 'description',
|
||||
render: function() {
|
||||
return (
|
||||
<Tester
|
||||
@@ -278,7 +280,6 @@ exports.examples = [
|
||||
},
|
||||
{
|
||||
title: 'Multistage With Multiply',
|
||||
description: 'description',
|
||||
render: function() {
|
||||
return (
|
||||
<Tester
|
||||
@@ -322,7 +323,6 @@ exports.examples = [
|
||||
},
|
||||
{
|
||||
title: 'Scale interpolation with clamping',
|
||||
description: 'description',
|
||||
render: function() {
|
||||
return (
|
||||
<Tester
|
||||
@@ -352,7 +352,6 @@ exports.examples = [
|
||||
},
|
||||
{
|
||||
title: 'Opacity without interpolation',
|
||||
description: 'description',
|
||||
render: function() {
|
||||
return (
|
||||
<Tester
|
||||
@@ -374,7 +373,6 @@ exports.examples = [
|
||||
},
|
||||
{
|
||||
title: 'Rotate interpolation',
|
||||
description: 'description',
|
||||
render: function() {
|
||||
return (
|
||||
<Tester
|
||||
@@ -403,7 +401,6 @@ exports.examples = [
|
||||
},
|
||||
{
|
||||
title: 'translateX => Animated.spring',
|
||||
description: 'description',
|
||||
render: function() {
|
||||
return (
|
||||
<Tester
|
||||
@@ -454,6 +451,19 @@ exports.examples = [
|
||||
</Tester>
|
||||
);
|
||||
},
|
||||
},{
|
||||
title: 'Drive custom property',
|
||||
render: function() {
|
||||
return (
|
||||
<Tester
|
||||
type="timing"
|
||||
config={{ duration: 1000 }}>
|
||||
{anim => (
|
||||
<AnimatedSlider style={{}} value={anim} />
|
||||
)}
|
||||
</Tester>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Animated value listener',
|
||||
|
||||
Reference in New Issue
Block a user