@null-studios/browser-router
v96.0.0
Published
> Simplest client-side rendering browser router.
Downloads
14
Readme
browser-router
Simplest client-side rendering browser router.
yarn add @null-studios/browser-router
Usage
import { ConfigurationRouter, Router } from 'browser-router';
import React, { FunctionComponent } from 'react';
// All application routes used to render different pages.
export const Configuration: ConfigurationRouter = {
routes: [
{
name: 'About',
path: '/about',
type: 'page',
destination: PageAbout,
},
{
name: 'Sitemap',
path: '/sitemap',
type: 'page',
destination: PageSitemap,
},
{
name: '',
path: '/',
type: 'redirect',
isExternal: false,
destination: '/home',
},
]
};
/*
* Application router.
*/
export const ApplicationRouter: FunctionComponent = () => {
return <Router configuration={Configuration} />;
};