This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-09
Channels
- # adventofcode (229)
- # announcements (1)
- # beginners (9)
- # boot (1)
- # calva (11)
- # cider (14)
- # clojure (26)
- # clojure-kc (1)
- # clojurescript (46)
- # core-async (10)
- # cursive (6)
- # datomic (53)
- # figwheel-main (2)
- # fulcro (3)
- # hoplon (2)
- # hyperfiddle (1)
- # kaocha (2)
- # off-topic (11)
- # om (5)
- # quil (11)
- # re-frame (7)
- # reagent (6)
- # reitit (9)
- # shadow-cljs (9)
- # spacemacs (5)
- # vim (5)
has anyone ever worked with react-spring
?
in clojurescript / reagent?
I’m basically trying to use its Transition
component. the usage in jsx is this
<Transition
items={items} keys={item => item.key}
from={{ transform: 'translate3d(0,-40px,0)' }}
enter={{ transform: 'translate3d(0,0px,0)' }}
leave={{ transform: 'translate3d(0,-40px,0)' }}>
{item => props =>
<div style={props}>{item.text}</div>
}
</Transition>
it has 2 closure functions as children
. so I’m trying to replicate the above like so
[:> spring/Transition {:items items
:keys :email
:from {:transform "translate3d(0, -40px, 0)"}
:enter {:transform "translate3d(0, 0px, 0)"}
:leave {:transform "translate3d(0, -40px, 0)"}}
(fn [player]
(fn [props]
(reagent/as-element [:div "hello"]))]
(edited)
but it throws an error saying it can’t render a function
Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
@bravilogy maybe (fn [player] (r/reactify-component (fn [props] [:div "hello"])))
Though I'm not sure how this would be different to providing component as fn and using as-element
Yeah, changelog mentions version 6 changed the API