useFind can accept () => null as argument. Previously it returned null in this scenario, so I changed the return statement because it was returning an empty array.
I also added setting the didMount flag before checking if the cursor is null or undefined. Without this, example above will return an empty array if returnNull will change to false
I fixed the behavior of
useFind
to pass a test in auseFind.tests.js
.useFind
can accept() => null
as argument. Previously it returnednull
in this scenario, so I changed the return statement because it was returning an empty array.I also added setting the
didMount
flag before checking if the cursor isnull
orundefined
. Without this, example above will return an empty array ifreturnNull
will change tofalse