Skip to content

Commit 6d78838

Browse files
committed
1 parent ce2c505 commit 6d78838

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/reagent/impl/component.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
tag (.-reagentRender jsprops)
402402

403403
;; Use counter to trigger render manually.
404-
[_ update-count] (react/useState 0)
404+
[_ force-update] (react/useReducer inc 0)
405405

406406
;; This object mimics React Class attributes and methods.
407407
;; To support form-2 components, even the render fn needs to
@@ -411,7 +411,7 @@
411411

412412
_ (when-not (.-current state-ref)
413413
(let [obj #js {}]
414-
(set! (.-forceUpdate obj) (fn [] (update-count inc)))
414+
(set! (.-forceUpdate obj) force-update)
415415
(set! (.-cljsMountOrder obj) (batch/next-mount-count))
416416
;; Use reagentRender name, as that is also used
417417
;; by class components, and some checks.

0 commit comments

Comments
 (0)