Atyantik/react-pwa

Page 404 and set class in html body

itgelo opened this issue · 1 comments

How to override default page 404?
can i set class in body tag?

@itgelo you can definitely set default 404 Page, via src/routes.tsx or src/routes.js
Please use something like below:

// Path to your 404 component
import NotFound from '@components/404';
// Path to your error component
import Error from '@components/error';

export default class ProjectRoutes {
  // eslint-disable-next-line class-methods-use-this
  public apply(routeHandler: RouterHandler) {
    // 404 Page
    routeHandler.set404Component(NotFound);
    routeHandler.setErrorComponent(Error);
    // ..other code
  }
}

Regarding body class, right now there is no such option, but we are adding that to upcoming releases:

image