当我添加 pageProps deHydratedState 时,出现错误Property 'deHydratedState' does not exit on type '{}' 。我试图使用 tanstack 网站https://tanstack.com/query/v4/docs/react/guides/ssr#using-Hydration中给出的文档配置 NextJs 应用程序以进行反应查询
我的应用程序是 NextJS Typescript。下面是我的配置文件
_app.tsx
// Client-side cache, shared for the whole session of the user in the browser.
const clientSideEmotionCache = createEmotionCache();
// interface MyAppProps extends AppProps {
// emotionCache?: EmotionCache;
// }
type CustomPage = NextPage & {
requiresAuth?: boolean;
redirectUnauthenticatedTo?: string;
dehydratedState?: any;
};
interface CustomAppProps extends Omit<AppProps, "Component"> {
Component: CustomPage;
emotionCache?: EmotionCache;
}
type ThemeMode = "light" …Run Code Online (Sandbox Code Playgroud)