Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mounishvatti/reactrouter
Implementing React Router Dom
https://github.com/mounishvatti/reactrouter
github-api hooks react-router-dom
Last synced: about 2 months ago
JSON representation
Implementing React Router Dom
- Host: GitHub
- URL: https://github.com/mounishvatti/reactrouter
- Owner: mounishvatti
- Created: 2024-08-11T13:07:53.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-11T18:25:41.000Z (5 months ago)
- Last Synced: 2024-08-12T14:53:29.182Z (5 months ago)
- Topics: github-api, hooks, react-router-dom
- Language: JavaScript
- Homepage: https://reactrouter-sigma.vercel.app
- Size: 60.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React router dom
React Router documentation - https://reactrouter.com/en/main
The application's url - https://reactrouter-sigma.vercel.app/
```js
let url = 'https://reactrouter-sigma.vercel.app/'
```## Getting Started
To run this project, you'll need to clone it from the GitHub repo and install the dependencies:
```bash
git clone https://github.com/mounishvatti/reactrouter.git
cd reactrouter
npm install
```Then, run the development server:
```bash
npm run dev
```Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Routes
url/ - https://reactrouter-sigma.vercel.app/
url/about - https://reactrouter-sigma.vercel.app/about
url/contact - https://reactrouter-sigma.vercel.app/contact
url/user/1 - https://reactrouter-sigma.vercel.app/user/1
-> can be a string or a numberurl/github - https://reactrouter-sigma.vercel.app/github -> shows my github info
```js
let username = 'sigma' //or whatever your github username is// replace it with your github username
url = 'https://reactrouter-sigma.vercel.app/github/' + username
```url/github/username - https://reactrouter-sigma.vercel.app/github/username
## Issue
You might face an issue where the routing does not occur and throws and `Error: 404` not found when you deploy the application to vercel and try doing a url change from the address bar.
But the same works fine locally on your machine.
To fix this issue, create a file called `vercel.json` in the root directory of your project and add the following code:
```json
{ "routes": [{ "src": "/[^.]+", "dest": "/", "status": 200 }] }
```## References
https://stackoverflow.com/questions/75963788/why-is-my-vercel-project-giving-me-an-error-404-on-refresh