Skip to content

Commit

Permalink
Merge pull request #23 from danielneal/master
Browse files Browse the repository at this point in the history
Pass initial value to react/useRef
  • Loading branch information
lilactown committed Feb 22, 2019
2 parents 169598a + 4ca3d6d commit 29e3703
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/hx/hooks.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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 %))))

Expand Down

0 comments on commit 29e3703

Please sign in to comment.