diff --git a/examples/react-sortable-hoc/project.clj b/examples/react-sortable-hoc/project.clj index 77c2460..e78c57c 100644 --- a/examples/react-sortable-hoc/project.clj +++ b/examples/react-sortable-hoc/project.clj @@ -3,7 +3,7 @@ [org.clojure/clojurescript "1.10.597"] [reagent "0.10.0"] [figwheel "0.5.19"] - [cljsjs/react-sortable-hoc "1.11.0-0"]] + [cljsjs/react-sortable-hoc "1.11.0-1"]] :plugins [[lein-cljsbuild "1.1.7"] [lein-figwheel "0.5.19"]] diff --git a/examples/react-sortable-hoc/src/example/core.cljs b/examples/react-sortable-hoc/src/example/core.cljs index 842ec8f..ccc35f9 100644 --- a/examples/react-sortable-hoc/src/example/core.cljs +++ b/examples/react-sortable-hoc/src/example/core.cljs @@ -1,14 +1,13 @@ (ns example.core (:require [reagent.core :as r] [reagent.dom :as rdom] - ;; FIXME: add global-exports support - [cljsjs.react-sortable-hoc] + [react-sortable-hoc :as sort] [goog.object :as gobj])) ;; Adapted from https://github.com/clauderic/react-sortable-hoc/blob/master/examples/drag-handle.js#L10 (def DragHandle - (js/SortableHOC.SortableHandle. + (sort/SortableHandle. ;; Alternative to r/reactify-component, which doens't convert props and hiccup, ;; is to just provide fn as component and use as-element or create-element ;; to return React elements from the component. @@ -16,7 +15,7 @@ (r/as-element [:span "::"])))) (def SortableItem - (js/SortableHOC.SortableElement. + (sort/SortableElement. (r/reactify-component (fn [{:keys [value]}] [:li @@ -27,7 +26,7 @@ ;; props is JS object here #_ (def SortableItem - (js/SortableHOC.SortableElement. + (sort/SortableElement. (fn [props] (r/as-element [:li @@ -35,7 +34,7 @@ (.-value props)])))) (def SortableList - (js/SortableHOC.SortableContainer. + (sort/SortableContainer. (r/reactify-component (fn [{:keys [items]}] [:ul