#Re-render 1 component but not another via the same queryKey?

6 messages · Page 1 of 1 (latest)

grizzled sage
#

I read that you can use select to subscribe to a sub-set of data, i.e I am assuming that when another component invokes invalidateQueries for the same queryKey, it shouldn't re-render the other component if the select returns a sub-set of data that did not change?

wanton scaffold
#

Can confirm this works well. I'm using selects a lot to prevent table rerendering. Selecting individual values in cells.

#

This is on data that is either polled, or streamed in multiple times per second. So constantly rewritten, only rerendered on select changes.

grizzled sage
#

Hmm doesn’t seem to work for me.

grizzled sage
#

Like I have two same query keys, one makes an update in a component, the other components select method returns an object with an ID and some other data. Both components are refetched

jovial sun
#

can you show a reproduction please?If you return the same data from select (can be a new reference as it will be structurally shared), your component shouldn't re-render