Fork me on GitHub
#reagent
<
2020-06-01
>
Spaceman08:06:33

@jcb I don't know why but with or without AnimatePresence I have to click twice or refocus on the page to make the animation happen. Do you have working code that actually works handy?

Spaceman08:06:26

@U0F7M1KA7 please reply with the code you mentioned (promised?)

Spaceman08:06:23

@jcb overall I'm using the #lumius framework with the reagent configuration, so the rendering happens however it handles it by default. I think lein new luminus app-name

jcb12:06:38

Apologies for the delay; don’t get to use clojure much atm. So something like this worked with reagent 8.1 and framer-motion 1.4.2. Also using shadow-cljs. simplified example - [:> AnimatePresence ^{:key :some-unique-data}[:> framer-motion/motion.div {:initial {:opacity 0} :animate {:opacity 1 :transition {:duration 0.8}} :exit {:opacity 1 :transition {:duration 0.8}} } [:h1 "some content"]]]

jcb12:06:25

haven't been able to look at the newer reagent or framer-motion APIs, so not sure if you'll still need to jump through a few hoops to use the motion hooks.