Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
NextJS Layout component not rendering page content

I'm trying to build a project using Next JS for the first time and I've seem multiple videos about the Layout component which seems like a good fit for my project!

However, I cannot get page content to show. The Menu and Footer shows without any problems but not the page content itself.

This is the code I have currently:

File: _app.js

import Layout from "../components/Layout";

import "../styles/globals.css";
import "antd/dist/antd.css"; // antDesign global css styles

const MyApp = ({ Component, pageProps }) => {
  return (
    <Layout>
      <Component {...pageProps} />
    </Layout>
  );
};

export default MyApp;

File: Layout.js

import React from "react";
import MainMenu from "../components/MainMenu";
import Footer from "../components/Footer";

const Layout = ({ childern }) => {
  return (
    <>
      <MainMenu />
      {childern}
      <Footer />
    </>
  );
};

export default Layout;

This "should" render my different page content and Menu/Footer should be visible on every page I create. I can see the Menu/Footer on every page but no content.

File: index.js

import React from "react";

const index = () => {
  return <h1>Home page!</h1>;
};

export default index;

File: *orders.js*

What am I missing?

One thing to note is that if I comment out Layout in the _app.js file the page content shows just fine, but then obviously the Menu/Footer won't show.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think you have a typo: childern -> children

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda