omcljs / om

ClojureScript interface to Facebook's React
6.66k stars 363 forks source link

SSR react checksum warning for equal markup #851

Closed petterik closed 7 years ago

petterik commented 7 years ago

Did: Used om.dom for server and client side rendering.

Happened:

Expected: React to not print the warning, as the server and client side render the same markup.

petterik commented 7 years ago

I narrowed the warning down to this minimal case:

(defui SSRBug
  Object
  (render [this]
    (dom/div
      #js {:style #js {:backgroundImage "&"}})))

Fixes warnings for me by escaping string values in the :styles map in om.dom: https://github.com/omcljs/om/blob/master/src/main/om/dom.cljc#L468

anmonteiro commented 7 years ago

fixed https://github.com/omcljs/om/commit/8730bbd9140a9ecd364904c4e464a0d9bf533284