小编adc*_*c 9的帖子

类型“{}”上不存在属性“deHydratedState”

当我添加 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)

configuration reactjs next.js react-query

0
推荐指数
1
解决办法
1249
查看次数

标签 统计

configuration ×1

next.js ×1

react-query ×1

reactjs ×1