Skip to content
Discussion options

You must be logged in to vote

we perform structural sharing on the result of the queryFn and the result of select. So even if select runs on every render, we keep the references stable if nothing changed. Dates can’t be compared though, so it will yield a new reference. You’d need to memoize select with useCallback for that.

.getTime() returns a primitive so it’ll work again. structural sharing is turned on per default, but only works for json serializable things.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yiqingfann
Comment options

Answer selected by yiqingfann
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