# monosky-react-router **Repository Path**: public-all/monosky-react-router ## Basic Information - **Project Name**: monosky-react-router - **Description**: A React router library - **Primary Language**: TypeScript - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-03 - **Last Updated**: 2024-09-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # monosky-react-router ### Install ```shell npm install @monosky/react-router # or yarn add @monosky/react-router # or pnpm add @monosky/react-router ``` ### Using ```jsx import {HistoryRouter, Route, useRouteMatch} from '@monosky/react-router'; function DefaultView() { return (
DefaultView
); } function ElementView() { return (
ElementView
); } function BlockView() { return (
BlockView
); } function ParamView() { // Get current routing matching information // Contains path, parameters, and query const match = useRouteMatch(); return (
ParamView:
{match.params.param}
); } export default function App() { return ( {/* default route */} )}/> )}/> {/* Equivalence matching */} )}/> {/* Any match and obtain the specified name parameter */} )}/> {/* Has Regular matching parameter, warpped in '()' */} )}/> {/* Has enumerated parameter, warpped in '[]' */} {/* The enumeration value will trim off spaces, Because it is not recommended to use spaces in the path */} )}/> {/* Any match, but no parameters */} )}/> {/* Matching multi-level paths */} ); } ```