      :shouldComponentUpdate
      (fn [next-props _]
        (this-as this
-                (or (not= (aget (.-props this) "color") (aget next-props "color"))
-                    (not= (aget (.-props this) "role") (aget next-props "role")))))
+                (or (not (== (aget (.-props this) "color") (aget next-props "color")))
+                    (not (== (aget (.-props this) "role") (aget next-props "role"))))))
      :componentDidMount
      (fn []
        (this-as this

(ns chessground.ui
  (:require [cljs.core.async :as a]
            [chessground.common :as common :refer [pp]]
            [chessground.react :as react]
            [chessground.data :as data]
            [chessground.chess :as chess]
            [chessground.premove :as premove]
            [chessground.drag :as drag]
            [chessground.api :as api])
  (:require-macros [cljs.core.async.macros :as am]))

(defn- piece-hash [props]
  (when-let [piece (aget props "piece")]
    (str (aget piece "color") (aget piece "role") (aget piece "draggable?"))))

(defn- make-diff [prev next]
  (fn [k] (not= (aget prev k) (aget next k))))

(def ^private piece-component
  (js/React.createClass

        chess (get app :chess)
        draggable-color (data/draggable-color app)
        last-move (array-of (get app :last-move))
        selected (get app :selected)
        check (get app :check)
        current-premove (array-of (get (get app :premovable) :current))
        move-dests (array-of (when-let [orig (get app :selected)]
                               (when (data/movable? app orig)
