cjohansen / dumdom

Efficiently render and re-render immutable data
Eclipse Public License 1.0
161 stars 9 forks source link

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

Closed 2food closed 1 year ago

2food commented 1 year ago

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).