This project is a comprehensive tutorial for react-router-dom
, designed to teach you how to manage navigation and routing in React applications. Created using the latest versions of React and React Router, this tutorial covers everything from basic to advanced routing concepts.
Before you begin, make sure you have the following installed:
- Node.js (LTS version recommended)
- npm or yarn as your package manager
To get started with this project, clone the repository and install the dependencies:
git clone https://github.com/YSHgroup/react-router-tutorial.git
cd react-router-tutorial
npm install
Or if you are using yarn:
yarn
Start the development server by running:
npm start
Or if you are using yarn:
yarn start
The application will launch in your default web browser at http://localhost:3000
.
The tutorial covers the following topics and features:
- Basic Routing with
<Route>
,<Routes>
, and<BrowserRouter>
- Nested Routing and Layouts
- Dynamic Route Parameters
- Using
<Link>
and<NavLink>
for navigation - Handling No Match (404) Routes
- Route Preloading and Lazy Loading with React Suspense
- Use of
useParams()
,useLocation()
,useRouteMatch()
, anduseHistory()
hooks
- React - A JavaScript library for building user interfaces
- React Router - The de-facto standard routing library for React
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Your Name - Initial work - YourUsername
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Thanks to the React Router team for providing such an excellent routing library.
- Shoutout to everyone who has contributed to the React ecosystem making front-end development more approachable.
For further reference, consult the official documentation:
Feel free to customize the README to match the specific details and features of your tutorial project.
-
@vitejs/plugin-react uses Babel for Fast Refresh
-
@vitejs/plugin-react-swc uses SWC for Fast Refresh