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

225
Views
Type '{ children: Element; }' is not assignable to type 'IntrinsicAttributes & (PathRouteProps | LayoutRouteProps | IndexRouteProps)'
const routes = [
{
    path: '/home',
    exact: true,
    name: 'Home',
    component: <Home />,
    private: true
},
{
    path: '/dashboard',
    exact: true,
    name: 'Dashboard',
    component: <Dashboard />,
    private: true
},
];
const Content = () => {
return (
    <div className="c-app c-default-layout" style={{background: "#E5E5E5"}}>
        <div className="c-wrapper">
            <Header name={"Riya"}/>
            <div className="c-body">
                <React.Suspense fallback={<div />}>
                    <Switch>
                        <Route path="/dashboard" children={<Dashboard />} />
                        {routesFile.map((route, idx) => {
                            return route.component && (
                                <Route
                                    key={idx}
                                    path={route.path}
                                    name={route.name}
                                    children={(props) => (
                                        <route.component {...props} />
                                    )} />
                            )
                        })}
                    </Switch>
                </React.Suspense>
            </div>
            <Footer />
        </div>
    </div>
)
}
export default Content;

Here I am getting the error while i try to give a dynamic paths to react component using react-router-dom. what should i put in so that it can run without an error? please help me with the code.

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!