Fork me on GitHub
#cljsrn
<
2017-06-07
>
danielneal16:06:49

has anyone had any success using react native native animations from clojurescript?

vikeri16:06:20

danielneal: Yes

danielneal16:06:48

how do you set it up?

danielneal16:06:55

I keep hitting Cannot add property _tracking, object is not extensible

danielneal16:06:11

I make an animated value (let [opacity (new rn/animated-value 0))

danielneal16:06:16

which seems to go ok

danielneal16:06:29

but (.start (.timing rn/animated opacity #js {:useNativeDriver true, :toValue 1, :duration 1000})) seems to make it unhappy

vikeri16:06:40

What is rn/animated?

vikeri16:06:29

I use:

(def animated (.-Animated react-native))
(def animated-view
  (r/adapt-react-class (.-View animated)))

vikeri16:06:49

Have you tried the example in pure js?

danielneal16:06:18

ah sorry yeah rn/animated is (.-Animated react-native)

danielneal16:06:45

ah do I need to use animated-view

danielneal16:06:58

It worked!!!

danielneal16:06:02

thanks 🙂 🎉

vikeri16:06:09

You’re welcome 🙂

danielneal16:06:10

I was just using a normal view

danielneal16:06:15

with an animated value