@bsonntag/router

0.2.0 • Public • Published

@bsonntag/router

CircleCI

A router implementation using React Hooks.

Usage

import { Route, Router, Switch } from '@bsonntag/router';
import About from './about';
import Home from './home';
import React from 'react';

function App() {
  return (
    <Router>
      <Switch>
        <Route path={'/'}>
          <Home />
        </Route>

        <Route path={'/about'}>
          <About />
        </Route>

        <Redirect to={'/'} />
      </Switch>
    </Router>
  );
}

Documentation

Read the docs.

Contributing

Please feel free to submit any issues or pull requests.

License

MIT

Package Sidebar

Install

npm i @bsonntag/router

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

19.5 kB

Total Files

12

Last publish

Collaborators

  • bsonntag