(create-element type)
(create-element type props)
(create-element type props child)
(create-element type props child & children)
Create a native React element, by calling React.createElement directly.
That means the second argument must be a javascript object (or nil), and
that any Reagent hiccup forms must be processed with as-element. For example
like this:
(r/create-element "div" #js{:className "foo"}
"Hi " (r/as-element [:strong "world!"])
which is equivalent to
[:div.foo "Hi" [:strong "world!"]]
Source
(defn
create-element
"Create a native React element, by calling React.createElement directly.\n\n That means the second argument must be a javascript object (or nil), and\n that any Reagent hiccup forms must be processed with as-element. For example\n like this:\n\n (r/create-element \"div\" #js{:className \"foo\"}\n \"Hi \" (r/as-element [:strong \"world!\"])\n\n which is equivalent to\n\n [:div.foo \"Hi\" [:strong \"world!\"]]"
([type] (create-element type nil))
([type props]
(assert-js-object props)
(react/createElement type props))
([type props child]
(assert-js-object props)
(react/createElement type props child))
([type props child & children]
(assert-js-object props)
(apply react/createElement type props child children)))