Skip to content

Animated.Value cannot have a listener attatched to it #4311

@Tatious

Description

@Tatious

Environment

react-native-cli: 2.0.1
react-native: 0.61.5
System:
OS: Windows 10 10.0.18363
CPU: (12) x64 Intel(R) Xeon(R) W-2133 CPU @ 3.60GHz
Memory: 15.79 GB / 31.73 GB
Binaries:
Node: 10.16.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
npmPackages:
react: 16.9.0 => 16.9.0
react-native: ^0.61.5 => 0.61.5
react-native-windows: 0.61.0-beta.22 => 0.61.0-beta.44
Installed UWP SDKs:
10.0.17763.0
10.0.18362.0

Steps to Reproduce

const myAnimatedValue = useAnimatedValue(0);
myAnimatedValue.addListener(({value}) => console.log(value));

useEffect(() => {
  const animation = Animated.parallel([
    Animated.sequence([
      Animated.timing(myAnimatedValue, {
        toValue: 100,
        delay: 0,
        duration: 300,
        easing: Easing.linear,
        useNativeDriver: true,
      }),
    ]),
  ]);
animation.start();
}, []);

Expected Behavior

The console prints the value as it changes

Actual Behavior

Nothing happens

Additional context

Adam Gorman(adamgor)
Austin Beaulieu(aubeauli)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions