⊗jsnxPmLtDf 32 of 57 menu

The Default Layout in NextJS

In the previous lesson, we found out that we should have a common site layout into which the content, title, and meta description of the page are inserted. NextJS already has a file with a common site layout by default. It is located in the file app/layout.jsx.

After installation, the layout file already contains some code. This code, however, contains a lot of unnecessary things. Let's create a minimal site layout that is easy to understand. To do this, open the layout file, delete everything from it, and paste the following:

export const metadata = { title: 'Test site', description: 'This is my page description.', }; export default function RootLayout({children}) { return ( <html lang="en"> <body> {children} </body> </html> ); }

Fix the default content in the main site layout.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline