Upgrade React and react-router-dom, Refactor Navigation to use useNavigate() hook #1487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses the following updates and improvements:
Performance Improvement:
Replaced the deprecated window.href.location with a more efficient navigation solution, improving the overall performance of the application.
React and react-router-dom Upgrade:
Upgraded the React version to the latest stable release to ensure compatibility with newer features and performance improvements.
Upgraded the react-router-dom version to align with the latest version, which includes breaking changes.
Refactor Routes for Compatibility:
Due to the deprecation of the old routing system, I’ve updated the routing configuration to work with the useNavigate() hook, which is now the preferred method for navigation in the latest version of react-router-dom.
This change improves routing consistency and makes the application more future-proof by adopting the latest best practices in routing.
While I initially planned to replace window.href.location, I encountered additional issues related to version upgrades and deprecated syntax. I worked through these challenges by seeking guidance and making necessary updates across multiple parts of the codebase.
This PR significantly improves the app's performance, maintains compatibility with the latest versions, and ensures it is using best practices for routing.