Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ienjoygit committed Jun 8, 2021
1 parent 0ac303b commit e45a7db
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,13 @@ function useSubscribedStateMethods<S>(
state.edition,
update,
);
React.useEffect(() => {
// useLayoutEffect here instead of useEffect because of this issue:
// https://github.com/avkonst/hookstate/issues/165#issuecomment-824670930
// and very likely this issue:
// https://github.com/avkonst/hookstate/issues/186
// and probably this issue:
// https://github.com/avkonst/hookstate/issues/145
React.useLayoutEffect(() => {
subscribeTarget.subscribe(link);
return () => {
link.onUnmount()
Expand Down

0 comments on commit e45a7db

Please sign in to comment.