Skip to content

heineiuo/react-router-stack-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-router-stack-switch

Demo: https://heineiuo.github.io/react-router-stack-switch/index.html

demo

Install

yarn add react-router-stack-switch

Usage

import React from 'react';
import { HashRouter, Route } from "react-router-dom";
import { StackSwitch } from "react-router-stack-switch";

const App: React.FC = () => {
  return (
    <HashRouter>
      <StackSwitch>
        <Route path="/" exact component={Home}></Route>
        <Route path="/learn/:chapter" exact component={Learn}></Route>
      </StackSwitch>
    </HashRouter>
  );
};

See: /src/App.tsx

License

MIT License

Releases

No releases published

Packages

No packages published