This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your app load context function that generates the remix context object | |
const generateAppLoadContext = async (c: Context, build: ServerBuild) => { | |
// example with i18n | |
const locale = i18next.getLocale(c); | |
const t = await i18next.getFixedT(c); | |
return { | |
appVersion: "v1.0", | |
lang: locale, | |
t, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { QueryClient } from "@tanstack/react-query"; | |
import { CacheAdapter, createCacheAdapter } from "remix-client-cache"; | |
export const queryClient = new QueryClient({ | |
defaultOptions: { | |
queries: { | |
staleTime: 1000 * 60 * 5, | |
}, | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { QueryClient } from "@tanstack/react-query"; | |
import { CacheAdapter, createCacheAdapter } from "remix-client-cache"; | |
export const queryClient = new QueryClient({ | |
defaultOptions: { | |
queries: { | |
staleTime: 1000 * 60 * 5, | |
}, | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { ZodType, z } from "zod"; | |
import { zodResolver } from "@hookform/resolvers/zod"; | |
import { getValidatedFormData as getValidatedFormDataPrimitive, useRemixForm as useForm, UseRemixFormOptions } from "remix-hook-form"; | |
interface UseRemixFormZodOptions<T extends ZodType, U extends FromZodType<T>> extends UseRemixFormOptions<U> { | |
schema: T; | |
} | |
export type FromZodType<T extends ZodType> = z.infer<T>; |