From 936f1d566b06a356962ce1f018ee65115d26c0d2 Mon Sep 17 00:00:00 2001 From: andres Date: Sun, 9 Jun 2024 15:00:28 +0200 Subject: [PATCH] fix revalidate on params change --- app/routes/_index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/routes/_index.tsx b/app/routes/_index.tsx index 5212872..ae65898 100644 --- a/app/routes/_index.tsx +++ b/app/routes/_index.tsx @@ -2,7 +2,11 @@ import { json, MetaFunction } from '@remix-run/node' import { vacanciesService } from '~/services/vacancies/vacancies.service' import { useLoaderData } from '@remix-run/react' import { VacanciesChart } from '~/components/vacancies-chart' +import type { ShouldRevalidateFunction } from '@remix-run/react' +export const shouldRevalidate: ShouldRevalidateFunction = ({ nextParams }) => { + return !nextParams +} export const meta: MetaFunction = () => { return [{ title: 'New Remix App' }, { name: 'description', content: 'Welcome to Remix!' }] }