cjohansen / dumdom

Efficiently render and re-render immutable data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discrepant handling of boolean in `dumdom.string/render`

2food opened this issue · comments

When giving boolean props to components, behavior is different between dumdom.core/render and dumdom.string/render.

Consider the following component:

(defcomponent checkbox
  [{:keys [checked]}]
  [:input  {:type     "checkbox"
            :checked checked}]])

If called with a boolean (checkbox {:checked false}),
dumdom.core/render renders it as </input type="checkbox" checked=false>,
but
dumdom.string/render renders it as </input type="checkbox" checked="false"> .

And since (not= "false" false), the component renders as checked by dumdom.string/render (until the component is inflated).