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: 2 comments 3 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants