Skip to content

Commit 29e3703

Browse files
authored
Merge pull request #23 from danielneal/master
Pass initial value to react/useRef
2 parents 169598a + 4ca3d6d commit 29e3703

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## [0.3.1] - Feb 20, 2019
3+
### Fixed
4+
- `<-ref`: Pass initial value to `react/useRef`
25

36
## [0.3.0] - Feb 10, 2019
47
### Changed

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject lilactown/hx "0.3.0"
1+
(defproject lilactown/hx "0.3.1"
22
:description "An easy to use, decomplected hiccup compiler for ClojureScript & React."
33
:url "https://github.com/Lokeh/hx"
44
:license {:name "Eclipse Public License"

src/hx/hooks.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"Takes an initial value. Returns an atom that will _NOT_ re-render component
3333
on change."
3434
[initial]
35-
(let [react-ref (react/useRef)
35+
(let [react-ref (react/useRef initial)
3636
update-ref (fn [v] (gobj/set react-ref "current" v))]
3737
(Atomified. [react-ref update-ref] #(.-current ^js %))))
3838

0 commit comments

Comments
 (0)