I’ve successfully managed to get ISR working on loader sites, but having absolutely no luck with codegen. I’ve asked a few times but keep being told to refer to docs - I’ve really done my best here but any help would be immensely helpful.
Right now, this is what I’ve got up to for my homepage. This successfuly creates an ISR page but the actual HTML doesn’t contain any prerendered code and the files are practically empty. How do I ensure that the entirety of my page is prerendered?
I’m just talking about static content. I want to get dynamically-rendered content to prerender too, but one thing at a time.
Someone save me
// This is a skeleton starter React page generated by Plasmic.
// This file is owned by you, feel free to edit as you see fit.
import * as React from "react";
import { PageParamsProvider as PageParamsProvider__ } from "@plasmicapp/react-web/lib/host";
import GlobalContextsProvider from "../components/plasmic/examplesite/PlasmicGlobalContextsProvider";
import { ThemeContext } from "../components/plasmic/examplesite/PlasmicGlobalVariant__Theme";
import { PlasmicHomepage } from "../components/plasmic/examplesite/PlasmicHomepage";
import { useRouter } from "next/router";
import { GetStaticProps } from "next";
export const getStaticProps: GetStaticProps = async () => {
// Add any data fetching logic here if needed, or return an empty props object
return {
props: {}, // Pass any necessary props here
revalidate: 60, // Revalidate at most every 60 seconds
};
};
function Homepage(props: any): JSX.Element {
return (
<GlobalContextsProvider>
<PageParamsProvider__
route={useRouter()?.pathname}
params={useRouter()?.query}
query={useRouter()?.query}
>
<PlasmicHomepage {...props} />
</PageParamsProvider__>
</GlobalContextsProvider>
);
}
export default Homepage;