Rasengan Logo
Rasengan Logo
  • Docs
  • Blog
  • Showcase
  • Support us
Using stable versionv1.2.0
Documentation
Packages
Templates
Rasengan UI Kit
Using stable versionv1.2.0
Documentation
Packages
Templates
Rasengan UI Kit

API REFERENCE

Router Component

RouterComponent is a class provided by Rasengan.js used to create Routers in your application.

Usage

TypeScript
JavaScript
app.router.tsx
tsximport { RouterComponent, defineRouter } from "rasengan"; class AppRouter extends RouterComponent {}; export default defineRouter({ imports: [], // Import others routers layout: null, // Set a layout pages: [] // Import pages })(AppRouter)

Properties

Here is the list of all the properties of RouterComponent class.

PropertiesTypeDescription
routersRouterComponent[]An array of other Router classes to be imported.
layoutLayoutComponentThe layout component to be used.
pagesPageComponent[]An array of page components to be used.
notFoundComponentReact.FCThe 404 page component to be used.
loaderComponentReact.FCThe loader component to be used.
useParentLayoutbooleanWhether to use the parent layout or not.

Rather than setting these values manually, the defineRouter does it for us and create a new instance of RouterComponent class and return it.

Page Component
ScrollRestoration

ON THIS PAGE

Usage
Properties
Rasengan Logo
Rasengan Logo

Resources

  • Docs
  • Packages
  • Blog
  • Showcase
  • Support us

Community

  • Github
  • X (Twitter)

Subscribe to the Newsletter

Stay informed to the news about rasengan.js including new releases, events, etc...

© 2024-2026 Rasengan Labs, All rights reserved.