@bsonntag/router

A router implementation with React Hooks.

Usage no npm install needed!

<script type="module">
  import bsonntagRouter from 'https://cdn.skypack.dev/@bsonntag/router';
</script>

README

@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