Is there a reason that rum doesnt expose a create-component
in its public api, basically defc without 5.
1. Wraps body into sablono/compile-html
2. Generates render function from that
3. Takes render function and mixins, builds React class from them
4. Using that class, generates constructor fn [args]->ReactElement
5. Defines top-level var with provided name and assigns ctor to it
For purposes of wrapping a component in an arbitrary fn.I don’t understand. What can you do with component but to instantiate it?
My imagined use case is needing to wrap a component so that it has closure over some vars etc.
(defn wrapped-component [x]
(create-component {:render [:div x] :will-update #(... x ...))}
Without having to to use defcs and inspect the args to fetch out something for example.Maybe this isnt a distinct use case, I'm not claiming to be right, I would just expect to be able to define my own function that returns a component.
well your function can just call rum function, can’t it?