Skip to content

Recommended usage with react hooks #884

Answered by dai-shi
noahw3 asked this question in Q&A
Discussion options

You must be logged in to vote

It's well-documented to not pass snapshots as hook dependencies. The eslint plugin does its best to try and prevent it. This is the best explanation I've found for why it's a bad idea - it may work, but depending on what properties of the snapshot are accessed, it may not.

This will be improved with less optimization in Valtio v2.
See: #866
See also: https://twitter.com/dai_shi/status/1764115879737123188 https://twitter.com/dai_shi/status/1766279254084550705 https://twitter.com/dai_shi/status/1763701256105922719

Replies: 1 comment 3 replies

Comment options

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

@noahw3
Comment options

@dai-shi
Comment options

Answer selected by noahw3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants