|
@@ -46,6 +46,7 @@ import { getServerSidePropsForInitial, getServerSidePropsForSameRoute } from './
|
|
|
import type {
|
|
import type {
|
|
|
Props, InitialProps, SameRouteEachProps, IPageToShowRevisionWithMeta,
|
|
Props, InitialProps, SameRouteEachProps, IPageToShowRevisionWithMeta,
|
|
|
} from './[[...path]]/types';
|
|
} from './[[...path]]/types';
|
|
|
|
|
+import { useInitialCSRFetch } from './[[...path]]/use-initial-skip-ssr-fetch';
|
|
|
import type { NextPageWithLayout } from './_app.page';
|
|
import type { NextPageWithLayout } from './_app.page';
|
|
|
import { NextjsRoutingType, detectNextjsRoutingType } from './utils/nextjs-routing-utils';
|
|
import { NextjsRoutingType, detectNextjsRoutingType } from './utils/nextjs-routing-utils';
|
|
|
import { useCustomTitleForPage } from './utils/page-title-customization';
|
|
import { useCustomTitleForPage } from './utils/page-title-customization';
|
|
@@ -157,6 +158,9 @@ const Page: NextPageWithLayout<Props> = (props: Props) => {
|
|
|
useSameRouteNavigation();
|
|
useSameRouteNavigation();
|
|
|
useShallowRouting(props);
|
|
useShallowRouting(props);
|
|
|
|
|
|
|
|
|
|
+ // If initial props and skipSSR, fetch page data on client-side
|
|
|
|
|
+ useInitialCSRFetch(isInitialProps(props) && props.skipSSR);
|
|
|
|
|
+
|
|
|
// Optimized effects with minimal dependencies
|
|
// Optimized effects with minimal dependencies
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
// Load YJS data only when revision changes and page exists
|
|
// Load YJS data only when revision changes and page exists
|