mirror of https://github.com/status-im/reagent.git
Allow symbols, keywords and arbitrary cljs objects in markup
React no longer defaults to applying toString, and instead throws confusing error messages when it encounters non-element objects. This should make that happen less often.
This commit is contained in:
parent
635e7c6e2a
commit
37b2954c3a
|
@ -318,6 +318,8 @@
|
|||
(seq? x) (if (dev?)
|
||||
(expand-seq-check x)
|
||||
(expand-seq x))
|
||||
(named? x) (name x)
|
||||
(satisfies? IPrintWithWriter x) (pr-str x)
|
||||
:else x))
|
||||
|
||||
(defn expand-seq [s]
|
||||
|
|
|
@ -956,3 +956,9 @@
|
|||
(deftest test-empty-input
|
||||
(is (= "<div><input/></div>"
|
||||
(rstr [:div [:input]]))))
|
||||
|
||||
(deftest test-object-children
|
||||
(is (= "<p>foo bar1</p>"
|
||||
(rstr [:p 'foo " " :bar nil 1])))
|
||||
(is (= "<p>#<Atom: 1></p>"
|
||||
(rstr [:p (r/atom 1)]))))
|
||||
|
|
Loading…
Reference in New Issue