Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

295
Views
La propiedad 'getLayout' no existe en Reactjs

Estoy trabajando con Reactjs y usando Nextjs. En este momento estoy tratando de "Usar múltiples encabezados" (según la condición), usé el siguiente código en mi archivo "about.js"

 import React from 'react' import NestedLayout from '../components/NestedLayout' import Footer from '../components/Footer' function About() { return ( <> <> //CODE HERE </> </> ) } export default About About.getLayout= function PageLayout(page) { return( <> <NestedLayout /> {page} <Footer /> </> ) }

Y aquí está mi archivo "_app.js"

 import React from 'react'; import App from 'next/app'; import Layout from '../components/layout' import type { AppProps } from 'next/app' function MyApp({ Component, pageProps }: AppProps) { if(Component.getLayout) { return Component.getLayout(<Component{...pageProps} />) } return ( <> <Layout> <Component {...pageProps} /> </Layout> </> ) } export default MyApp

Pero recibo el siguiente error, ¿cómo puedo resolver esto?

 any Property 'getLayout' does not exist on type 'NextComponentType<NextPageContext, any, {}>'. Property 'getLayout' does not exist on type 'ComponentClass<{}, any> & { getInitialProps?(context: NextPageContext): any; }'.ts(2339)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!