This works, but there's a brief moment where it loads everything regardless of user_id. I can't fix it by using row level security, because those other rows are intended to be public, just displayed elsewhere. They flash for a moment, then disappear again. If I console.log the retrieved dcouments, you can see the hook first returns 0 (before fetching), then 11 (with isFetching set to false), then 11 with isFetching set to true, then 2, then 11, then 2 again. 2 is the number of elements after filtering.
I'm trying to load data belonging to some user like this:
This works, but there's a brief moment where it loads everything regardless of
user_id
. I can't fix it by using row level security, because those other rows are intended to be public, just displayed elsewhere. They flash for a moment, then disappear again. If Iconsole.log
the retrieved dcouments, you can see the hook first returns 0 (before fetching), then 11 (withisFetching
set to false), then 11 withisFetching
set to true, then 2, then 11, then 2 again. 2 is the number of elements after filtering.