T
TanStack3y ago
eager-peach

Array as queryKey

What happens here:
queryKey: [
tradeOperation,
'nftsForTrading',
Object.keys(collections).sort(),
Object.values(prices).sort(),
],
queryKey: [
tradeOperation,
'nftsForTrading',
Object.keys(collections).sort(),
Object.values(prices).sort(),
],
WIll this refetch on every re-render cuase Object.keys craetes new reference every time, or is it going to look elements inside of an array so if something inside of an array changes only then it will re-trigger api call
2 Replies
flat-fuchsia
flat-fuchsia3y ago
It's fine
eager-peach
eager-peachOP3y ago
Thanks!

Did you find this page helpful?