I am currently using the Recoil library in my project and I am having some trouble with how to store the ids for an atomFamily. I have looked at solutions on Stack Overflow and the common answer seems to be using an array, but I'm not happy with this solution because it's causing performance issues for me & I can't figure out how to incrementally load all the items onto a screen using this method.
Is there a better and more efficient way to store the ids for an atomFamily in Recoil? I would really appreciate if anyone could share any alternative methods they have tried. Thank you!
Example:
const meals = atomFamily({
key: "meals",
default: {}
});
const mealIds = atom({
key: "mealsIds",
default: []
});