The demo at https://reactrouter.com uses contacts stored in local storage, and when a contact is selected from the sidebar, it appears the loader reads all of the contacts again:
export async function getContact(id) {
await fakeNetwork(`contact:${id}`);
let contacts = await localforage.getItem("contacts");
let contact = contacts.find(contact => contact.id === id);
return contact ?? null;
}
Is this what is happening?
How do I have a child component (using the same approach as in the demo) access previously loaded data from the parent component without fetching a new?