Skip to content

The result of getSnapshot should be cached to avoid an infinite loop #1936

Closed Answered by jcuenod
jcuenod asked this question in Bug report
Discussion options

You must be logged in to vote

Thank you, I figured it out. The problem was that I was using useX callbacks to get around some eslint errors about the use of useX hooks outside react components. The actual solution was:

const myState = useMyStore.getState()

Replies: 7 comments 18 replies

Comment options

You must be logged in to vote
3 replies
@jcuenod
Comment options

@dai-shi
Comment options

@jcuenod
Comment options

Answer selected by jcuenod
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@tylim88
Comment options

@SOMONSOUM
Comment options

@dai-shi
Comment options

@SOMONSOUM
Comment options

@dai-shi
Comment options

Comment options

You must be logged in to vote
1 reply
@dai-shi
Comment options

Comment options

You must be logged in to vote
1 reply
@dai-shi
Comment options

Comment options

You must be logged in to vote
3 replies
@dai-shi
Comment options

@Jumzeey
Comment options

@dai-shi
Comment options

Comment options

You must be logged in to vote
4 replies
@dai-shi
Comment options

@Nour-benmohamed-Git
Comment options

@dbritto-dev
Comment options

@Toshinaki
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet