Error route

A special route called errorRoute is registered that will match when the route doesn’t match (exact or partial) any route in the routing configuration. You can use this route to render a widget to inform the user that the route does not exist.

  1. import { create, tsx } from '@dojo/framework/core/vdom';
  2. import Route from '@dojo/framework/routing/Route';
  3. const factory = create();
  4. export default factory(function App() {
  5. return (
  6. <div>
  7. <Route
  8. id="errorRoute"
  9. renderer={() => {
  10. return <div>Unknown Page</div>;
  11. }}
  12. />
  13. </div>
  14. );
  15. });

If there is a default route registered, this will take precedence over the error route on the initial application load.