File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
3- ## Added
4-
53## Fixed
64
7- ## Changed
5+ - Support using ` defstyled ` components as reagent form-2 components
86
97# 0.9.87 (2023-04-15 / dac82f4)
108
7472
7573## Added
7674
77- - Initial implementation
75+ - Initial implementation
Original file line number Diff line number Diff line change 420420 attributes passed in via the `::attrs` property."
421421 [tag css-class args component]
422422 (if component
423- (expand-hiccup-tag-simple tag css-class (apply component args) (::attrs (first args)))
423+ (let [result (apply component args)]
424+ (if (fn? result)
425+ (fn [& args]
426+ (expand-hiccup-tag-simple tag css-class (apply result args) (::attrs (first args))))
427+ (expand-hiccup-tag-simple tag css-class result (::attrs (first args)))))
424428 (expand-hiccup-tag-simple tag css-class (seq args) nil )))
425429
426430(defn styled
Original file line number Diff line number Diff line change 131131 :color " #cff9cf"
132132 :text-decoration " underline" })
133133
134+ (o/defstyled form-2 :div
135+ ([a]
136+ (fn [b]
137+ [:<> " hello" ])))
138+
139+
134140#?(:clj
135141 (deftest css-test
136142 (is (= " .ot__simple{color:#fff}"
248254 [:a ] [:a ] [:a ] [:a ] [:a ] [:a ] [:a ] [:a ] [:a ] [:a ] [:a ]
249255 [:a ] [:a ] [:a ] [:a ]]
250256 " <span class=\" ot__simple\" ><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a></span>"
257+ [(form-2 7 ) {::o/attrs {:data-a 11 }}]
258+ " <div data-a=\" 11\" class=\" ot-form-2\" >hello</div>"
251259
252260 ))
253261
You can’t perform that action at this time.
0 commit comments