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

322
Views
In react I had created wrapper components.So now i need to use them in my app.tsx in element parameter which is in route tag.But error as not jsx elem

'Catalog' cannot be used as a JSX component. Its return type 'CatalogState' is not a valid JSX element. Type 'CatalogState' is missing the following properties from type 'ReactElement<any, any>': type, props, keyts(2786)

here catalog is my wrapper component THIS IS THE ROUTE PART WHERE I AM USING CATALOG AS A WRAPPER COMPONENT

<Routes>
       {/* <Route path={BASE}/></Catalog> */}
        {/* <Route path={BASE} element={<PrimeCatalogContainer/>} /> */}
        <Route path={BASE} element={()=>(<Catalog><PrimeCatalogContainer/></Catalog>)}/>
        <Route path={PRIME_CATALOG} element={<PrimeCatalogContainer />} />
        <Route path={PRIME_TRAINING} element={<PrimeTrainingPage />} />
        <Route path={PRIME_INSTANCE} element={<PrimeInstancePage />} />
        <Route path={PRIME_ALMPROFILE} element={<ALMProfilePage />} />
        <Route 
          path={PRIME_BOARDPAGE}
          element={<PrimeCommunityBoardPage />}
        />
        <Route
          path={PRIME_BOARDLIST}
          element={<PrimeCommunityBoardList />}
        />
    </Routes>

CATALOG COMPONENT

import { PrimeCatalogContainer } from "./almLib";
const Catalog = () =>{
  return(
    <>
    <div
        className="catalog_container"
        data-show-filters="true"
        data-show-search="true"
        data-catalogs="true"
        data-lo-types="true"
        data-skill-name="true"
        data-lo-format="true"
        data-duration="true"
        data-price="true"
        data-skills-level="true"
        data-learner-state="true"
        data-tag-name="true"
        data-skill-level="true"><PrimeCatalogContainer/>
     </div>
    </>
  );
};

instead of above catalogcomponent I tried below one also

import { PrimeCatalogContainer } from "./almLib";
  function Catalog (): JSX.Element {
    return(
        <div
        className="catalog__container"
        data-show-filters="true"
        data-show-search="true"
        data-catalogs="true"
        data-lo-types="true"
        data-skill-name="true"
        data-lo-format="true"
        data-duration="true"
        data-price="true"
        data-skills-level="true"
        data-learner-state="true"
        data-tag-name="true"
        data-skill-level="true"
      ><PrimeCatalogContainer/></div>
    );
 };
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

As stated in the docs, element should be a ReactNode, so instead of:

<Route path={BASE} element={()=>(<Catalog><PrimeCatalogContainer/></Catalog>)}/>

you need to return the actual Catalog

<Route path={BASE} element={<Catalog><PrimeCatalogContainer/></Catalog>}/>
about 4 years ago · Santiago Gelvez 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!