Fork me on GitHub
#fulcro
<
2018-05-28
>
myguidingstar05:05:00

I have this idea of reusing fulcro components between web and react native: in many cases the web component and its RN equivalent only differ in render method

myguidingstar05:05:02

I wonder if I can do something like:

(defsc MyComponent {:ident ... :query..}) ;; no render
(def MyComponentWeb (extend-component MyComponent {:life-cycle-methods ...})
(def MyComponentRN (extend-component MyComponent {:life-cycle-methods ...})

myguidingstar05:05:35

what do you think?

wilkerlucio11:05:08

@myguidingstar I think they are different UI's, IMO fulcro makes that easy that justify duplication, after all most of the complexity is on the server, just declare the components as you need, I don't see much value on trying to share, might end up hurting

👍 1
wilkerlucio11:05:03

in my experience trying to create this extension classes tend to do bad with time

wilkerlucio11:05:15

better to have the queries and idents as variables somewhere else and just re-use it