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

122
Views
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes' on react layout component

This is the code for the layout

import type { NextPage } from 'next'
import React from 'react'
 
interface LayoutProps {
 children: React.ReactNode;
}
 
const Layout: NextPage = ({ children }: LayoutProps) => {
 return (
   <>
     <div>
       <main>
         {children}
       </main>
     </div>
   </>
 );
};
 
 
export default Layout

The error appears when I hover over the start of the layout element in this block of code which is the main part of the app.

import type { AppProps } from 'next/app'
import Layout from '../components/Layout'
import '../styles/globals.css'
 
function MyApp({ Component, pageProps }: AppProps) {
 return (
   <Layout>
     <Component {...pageProps} />
   </Layout>
 )
}
export default MyApp

I thought at first that it was because I didn’t have the right type for the children but I made a type for the children but I made an interface for that but I still am receiving the error.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try with generics

import type { NextPage } from 'next'
import React from 'react'
 
interface LayoutProps {
 children: React.ReactNode;
}
 
const Layout: NextPage<LayoutProps> = ({ children }) => {
 return (
   <>
     <div>
       <main>
         {children}
       </main>
     </div>
   </>
 );
};
 
 
export default Layout
about 4 years ago · Santiago Trujillo Report
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!