Skip to content

Commit

Permalink
call useStoreContext unconditionally to avoid rules of hooks violation (
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdanielduffy authored Nov 10, 2023
1 parent 3a8ad87 commit c8caaa5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/leva/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@
!state (:atom opts)
initial (if !state (.-state !state) {})
ks (keys initial)
opts (update opts :store #(or % (l/useStoreContext)))
store (l/useStoreContext)
opts (update opts :store #(or % store))

;; NOTE that if we want to add a hook deps array here, we can conj it
;; onto the end of the vector returned by [[leva.schema/opts->argv]]. In
Expand Down

0 comments on commit c8caaa5

Please sign in to comment.