File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 2828 (or (named? x)
2929 (string? x)))
3030
31+ (defn ^boolean reagent-fn-component? [^clj x]
32+ (.-reagent-component x))
33+
3134(defn ^boolean valid-tag? [^clj x]
3235 (or (hiccup-tag? x)
33- (.- reagent-component x)
36+ (reagent-fn- component? x)
3437 (ifn? x)
3538 (instance? NativeWrapper x)))
3639
171174 (set! (.-key jsprops) key))
172175 (react/createElement c jsprops)))
173176
174- (defn reag-element-2 [tag v]
177+ (defn defc-element
178+ " Tag is a React function component already wrapped
179+ with Reagent function component implementation. This function just
180+ needs to wrap the Hiccup element children into the React element
181+ properties and set up the optional React key if set."
182+ [tag v]
175183 (let [jsprops #js {}]
176184 (set! (.-argv jsprops) (subvec v 1 ))
177185 (when-some [key (util/react-key-from-vec v)]
300308 :f> (function-element (nth v 1 nil ) v 2 compiler)
301309 :<> (fragment-element v compiler)
302310 (cond
303- (.- reagent-component tag)
304- (reag -element-2 tag v)
311+ (reagent-fn- component? tag)
312+ (defc -element tag v )
305313
306314 (hiccup-tag? tag)
307315 (hiccup-element v compiler)
You can’t perform that action at this time.
0 commit comments