Fork me on GitHub
#rum
<
2017-01-23
>
leov09:01:37

does anyone have a link to example, how to integrate 3d-party javascript react components (like this one https://github.com/maisano/react-router-transition) with rum?

leov09:01:49

yeah, pic related.

Niki11:01:24

@leon like this?

(rum/defc route-transition [pathname children]
  (js/React.createElement js/RouteTransition
    #js { :pathname pathname
          :atEnter  #js { :opacity 0 }
          :atLeave  #js { opacity: 0 }
          :atActive #js { opacity: 1 } }
    (clj->js children)))

misha11:01:53

@tonsky does it create 2 components: rum and a nested RouteTransition ones?

Niki11:01:17

well if you change defc to defn it wouldn’t

misha11:01:31

is it "ok"? from the performance/purity/etc. povs?

Niki11:01:06

what is ok? two components or defn?

misha11:01:49

2 nested components

misha11:01:28

which is it better/more practical to wrap 3rd-party components with?: rum component function marcos

Niki11:01:47

in that case, function would be better

leov12:01:53

@tonsky omg. thanks. so it's just like that =/

leov12:01:41

thanks thanks

leov12:01:52

I will learn it someday. so many layers of abstraction)

leov12:01:25

doing front-end is so much fun, turns out

leov12:01:42

animations or even just trying to layout simple three blocks of text for 3 versions of the screen

martinklepsch14:01:32

> Note: See how defn is used here instead of defc? Using defc would cause two components being created (e.g. range-slider and the Slider component). Because in many cases you don't need the wrapping component you can just use defn. added this, think it’s an interesting observation