                        (case (:sort-order @state)
                          :asc (swap! state assoc :sort-order :desc)
                          :desc (swap! state dissoc :sort-column :sort-order :key-fn)
-                         :else (assert false "bad state"))
+                         (assert false "bad state"))
                        (swap! state assoc :sort-column i :sort-order :asc
                          :key-fn (if (= :value sorter)
                                    (fn [row] (nth row i))

       [:div {}
        (when (:filterable? props)
          (let [apply-filter #(swap! state assoc :filtered-data
                               (react/call :filter-data this (-> (@refs "filter-field") .getDOMNode .-value trim)))]
            [:div {:style {:padding "0 0 1em 1em"}}
             (style/create-text-field {:ref "filter-field" :placeholder "Filter"
                                       :onKeyDown (common/create-key-handler

         (:data props))))
   :handle-pagination-change
   (fn [{:keys [this refs]}]
     (react/call :set-rows (@refs "body") (react/call :get-sliced-data this)))
   :component-will-receive-props
   (fn [{:keys [this state next-props refs]}]
     (swap! state assoc :filtered-data
       (react/call :filter-data this next-props (-> (@refs "filter-field") .getDOMNode .-value trim))))})
