You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a key is an empty array, suspend is called in an infinite loop, due to [] !== [] in js
// lets say this returns "[]"constinvoices=someCallFromDb()// this is never settled, infinite loopedconstpaymentMoraleValues=suspend(async()=>paymentMoraleFromInvoices(invoices),['paymentMoraleValues',invoices])
I know one can provide custom equality functions, but should such a basic case not be covered straight out of the box?
Would be a simple as making shallowEqualArrays account for it.
The text was updated successfully, but these errors were encountered:
tom2strobl
changed the title
shallowEqualArrays falling short in a very basic way
shallowEqualArrays falling short when using empty array as key
Mar 17, 2023
If a key is an empty array, suspend is called in an infinite loop, due to
[] !== []
in jsHere's a sandbox for reproduction: https://codesandbox.io/s/suspend-react-infinite-rerender-mq391t
I know one can provide custom equality functions, but should such a basic case not be covered straight out of the box?
Would be a simple as making
shallowEqualArrays
account for it.The text was updated successfully, but these errors were encountered: