farmcommand2
farmcommand2

Reputation: 1496

what numbers instead of zero can i use at `Animated.ValueXY(100, 100);`

when I use 100 as initial values for ValueXY at new Animated.ValueXY(100, 100); i get this error

Error: AnimatedValueXY must be initalized with an object of numbers or AnimatedValues.

but when i set them to 0 they or just pass nothing it works fine.

Upvotes: 0

Views: 261

Answers (1)

bennygenel
bennygenel

Reputation: 24680

Animated.ValueXY(..) expects an object of numbers or AnimatedValues like the error says. To use different values then 0 you need to give them as an object.

Animated.ValueXY({x:100, y: 100})

When you use Animated.ValueXY(0 ,0) it might be taking 0 as a falsey and using the default values like you initiated it like Animated.ValueXY(). This is just a guess though. Maybe someone with more info can give it a better explanation.

Upvotes: 1

Related Questions