diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a9a8c..f1acb80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Changelog +## [0.3.1] - Feb 20, 2019 +### Fixed +- `<-ref`: Pass initial value to `react/useRef` ## [0.3.0] - Feb 10, 2019 ### Changed diff --git a/project.clj b/project.clj index 445a3da..d39c743 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject lilactown/hx "0.3.0" +(defproject lilactown/hx "0.3.1" :description "An easy to use, decomplected hiccup compiler for ClojureScript & React." :url "https://github.com/Lokeh/hx" :license {:name "Eclipse Public License" diff --git a/src/hx/hooks.cljs b/src/hx/hooks.cljs index ca6c9a4..f2d4582 100644 --- a/src/hx/hooks.cljs +++ b/src/hx/hooks.cljs @@ -32,7 +32,7 @@ "Takes an initial value. Returns an atom that will _NOT_ re-render component on change." [initial] - (let [react-ref (react/useRef) + (let [react-ref (react/useRef initial) update-ref (fn [v] (gobj/set react-ref "current" v))] (Atomified. [react-ref update-ref] #(.-current ^js %))))