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

179
Views
NotFound page rendering above all components

I've had a problem with rendering NotFound page with the following code, component Routing is a children in my Switch component located in App.tsx:

const Routing = (): JSX.Element => {
  return (
    <>
      {publicRouting.map(({ path, component }, i) => (
        <Route key={i} path={path} component={component} />
      ))}
      {isAuthenticated() && (
        <Main>
          {routing.map(({ path, component }, i) => (
            <Route exact key={i} path={path} component={component} />
          ))}
        </Main>
      )}
    </>
  );
};

my publicRouting and routes used above:

export const publicRoutes = {
  login: "/login",
  notFound: "*"
};

export const publicRouting = [
  { path: publicRoutes.login, component: Login },
  { path: publicRoutes.notFound, component: NotFound }
];

can someone tell me why, after logging in to private routes (isAuthenticated() === true) my NotFound page is always rendering above the Main component?

Here is the small screenshot of this situation, NotFound component is physically rendering above the Main component and his children enter image description here

If anyone want more code then it feel free, I will paste it

thanks for any help!

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!