Fork me on GitHub
#rum
<
2017-02-27
>
mruzekw16:02:05

I’m trying to use a 3rd party react component ala this doc: https://github.com/tonsky/rum/wiki And I keep coming upon an error like:

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of `<insert component name here>`.
Any idea what’s going on?

sebastjan.pereyro16:02:24

you trying to render something wrong

mruzekw16:02:31

Indeed, I got that part of it. But I seem to be missing something

mruzekw16:02:33

#?(:clj (rum/defcs horizontal-scroll [])
     :cljs (defn horizontal-scroll [rev-scroll children]
              (js/React.createElement js/ReactScrollHorizontal
                                      #js {:reverseScroll rev-scroll}
                                      (clj->js children))))

sebastjan.pereyro17:02:39

looks good. maybe something in children?

mruzekw17:02:12

#?(:clj (rum/defc horizontal-scroll [])
   :cljs (defn horizontal-scroll []
              (js/React.createElement js/ReactScrollHorizontal)))

mruzekw17:02:24

Simplified it a bit and still getting the same error

sebastjan.pereyro17:02:47

how you import ReactScrollHorizontal?

sebastjan.pereyro17:02:45

probably js/ReactScrollHorizontal is an object with key default

mruzekw17:02:05

That’s it

sebastjan.pereyro17:02:58

so use fn at this key

mruzekw17:02:13

Cool, thanks for your help