Open tom2strobl opened 1 year ago
If a key is an empty array, suspend is called in an infinite loop, due to [] !== [] in js
[] !== []
// lets say this returns "[]" const invoices = someCallFromDb() // this is never settled, infinite looped const paymentMoraleValues = suspend( async () => paymentMoraleFromInvoices(invoices), ['paymentMoraleValues', invoices] )
Here'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.
shallowEqualArrays
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.