@null-studios/browser-router
TypeScript icon, indicating that this package has built-in type declarations

96.0.0 • Public • Published

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} />;
};

Readme

Keywords

none

Package Sidebar

Install

npm i @null-studios/browser-router

Weekly Downloads

9

Version

96.0.0

License

SEE LICENSE IN LICENSE

Unpacked Size

102 kB

Total Files

56

Last publish

Collaborators

  • nate-wilkins