Fork me on GitHub
#om
<
2017-06-27
>
ashercoren09:06:07

Hi, I'm updating the react and om version in my app. One of the required changes is using CSSTransitionGroup from react-transition-group instead of react-with-addons. How do I use it in om? I have included react-transition-group as a dependency in my project.clj and required cljsjs.react-transition-group in my cljs code. But when I try adding it to an om component by calling ((.-CSSTransitionGroup js/ReactTransitionGroup)) I get an error: Cannot call a class as a function

danielstockton09:06:50

@ashercoren Perhaps something like (js/React.createElement (.-CSSTransitionGroup js/ReactTransitionGroup) #js {:transitionName "name" ...})? The error seems quite self explanatory (CSSTransitionGroup is a class and you can't call it as a function).

ashercoren09:06:00

@danielstockton Thank you. It works. Although I don't like the idea of explitly calling React.createElement when in om...

danielstockton09:06:24

(dom/create-element (.-CSSTransitionGroup js/ReactTransitionGroup) #js {}) then?

ashercoren09:06:11

dom/create-element :thumbsup: