-
I'm building an offline-first app where data is primarily stored in local storage using localForage. Here's a simplified version of my index route: import { useLoaderData } from 'react-router-dom'
import type { LoaderFunction } from '@remix-run/router'
import { getLedgers } from '../../../data/local'
export const loader: LoaderFunction = async (): Promise<string[]> => {
return getLedgers()
}
function Root() {
const ledgers = useLoaderData() as Awaited<string[]>
return <>{ledgers.join(', ')}</>
}
export const element = <Root /> If the user signs into Google, a worker is added to the page, syncing data to/from Google Sheets in the background. As the worker updates the local data store, it sends an event to the main process. How can I manually/procedurally trigger a reload of the This also seems relevant to apps that use subscriptions with GraphQL, WebSockets, or other architectures. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
const navigate = useNavigate()
navigate('.', { replace: true }) |
Beta Was this translation helpful? Give feedback.
-
I landed here after a google search for "retry loader manually for selected differed requests" Is something like this possible? I have multiple request which are I know I can more fetching to the component, but I would like to know if I can do it using the react router loader instead and keep thing simpler. |
Beta Was this translation helpful? Give feedback.
-
sorry but i have a problem, i using tanstack table, when i removed item in page number is 7 and call revalidator.revalidate(); |
Beta Was this translation helpful? Give feedback.
-
@DatTN95 Ideally, you should be put your search params in the URL through a query string, so you would be good to go! |
Beta Was this translation helpful? Give feedback.
Also you don't need to do the
navigate(".")
anymore, use the useRevalidator hook instead