Layout Component

PHOTO EMBED

Sat Jan 15 2022 17:58:55 GMT+0000 (UTC)

Saved by @GodFather #javascript

//Base
File:component/Layout
import Head from "next/head";

function Layout(props) {
  return (
    <>
      <Head>
        <title>{props.title}</title>
    	<link rel="icon" href="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSqDf8kObAr4H1Eq4AowjBo3lb0IblH0hflxY5Fy5NFO6jEB2N1vMhDbtnyzivnuSbaLSM&usqp=CAU"></link>
      </Head>
      {props.children}
    </>
  );
}

export default Layout;

//Pemakaian
File:page/index.js

<Layout title="Home"> //props variabel title
  
  //children
    <div className="container mx-auto mt-8"> 
      <h1 className="font-bold">Hello Word!</h1>
    </div>
 //endChildren

</Layout>
content_copyCOPY