1
import Head from "next/head";
import Image from "next/image";
import { Inter } from "@next/font/google";
import styles from "../styles/Home.module.css";
import Layout from "../layouts/Layout";

const inter = Inter({ subsets: ["latin"] });

export default function Home() {
  return (
    <>
      <div className="m-5">
        <div className="bg-white h-[400px] flex justify-center items-center text-4xl">
          Welcome to Dashboard
        </div>
      </div>
    </>
  );
}
Home.getLayout = function getLayout(page) {
  return <Layout>{page}</Layout>;
};

export async function getStaticProps() {
  return { props: { title: "HomePage" } };
}

I need to pass props from getStaticprops to Layout Component. i tried to pass as props but it doesnt working. Can someone help eith this?

apnerve
  • 4,740
  • 5
  • 29
  • 45
karthi
  • 31
  • 2
  • This seems to be working. You'll get the props in the `Home` component. What's the issue you are facing? If you are expecting it to come inside the `Layout` component, it won't – apnerve Mar 30 '23 at 12:04

0 Answers0