devFind icon indicating copy to clipboard operation
devFind copied to clipboard

feat: Implement react-router-dom for routing

Open adarshswaminath opened this issue 1 year ago • 1 comments

Description

This PR updates the App component to use react-router-dom for routing, replacing the previous pathname-based conditional rendering. This change enhances navigation and improves code maintainability

Changes Proposed

1.Added Routing

  • Implemented BrowserRouter, Route, and Routes for robust navigation.
  • Defined routes for the main page and invalid routes

Checklist

  • [x] I have read and followed the Contribution Guidelines.
  • [x] All new and existing tests passed.
  • [ ] I have updated the documentation to reflect the changes I've made.
  • [x] My code follows the code style of this project.
  • [x] The title of my pull request is a short description of the requested changes.

Benefits of react-router-dom Routing:

  • Cleaner and more maintainable code structure.
  • Easier scalability and addition of new routes.
  • Built-in features like nested routes and redirects.

Drawbacks of Pathname Conditional Rendering:

  • Cluttered and harder-to-maintain code.
  • Limited flexibility and inconsistent navigation.

Screenshots

1.Current Production (Invalid Route) image

2.Updated Code (Invalid Route) image

adarshswaminath avatar May 23 '24 06:05 adarshswaminath

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dev-find ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2024 6:18am

vercel[bot] avatar May 23 '24 06:05 vercel[bot]