shabados / presenter

Desktop app for presenting the Shabad OS Database on projectors, TVs, and live streams

Home Page:https://shabados.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update React Router v5 functions to v6

ManpreetSL opened this issue Β· comments

Summary

React Router DOM package is changing things around in v6. See here for more details.
2 issues that we've identified are:

  • The app currently uses the old useHistory() hook from the React Router package, but the TS branch has v6 installed, so we'd like to update usages of the old function to its replacement, useNavigate() wherever possible.
  • v5's <Redirect /> component is used, but v6 uses <Navigate /> instead

Approach

  • Find usages of useHistory()
  • Import the useNavigate() function
  • Use useNavigate()'s navigate function instead of useHistory()'s .push()
  • Find usages of the <Redirect /> component
  • Replace <Redirect /> with <Navigate />

Awesome work! Thank you for the time πŸ”₯ πŸ‘ πŸ’―

As a side note: If you're ready to open a PR already, I don't think it makes much sense to open an issue just prior to the PR. The issues are more for tracking purposes and communication I think.

Awesome work! Thank you for the time πŸ”₯ πŸ‘ πŸ’―

As a side note: If you're ready to open a PR already, I don't think it makes much sense to open an issue just prior to the PR. The issues are more for tracking purposes and communication I think.

:)
Ahh yeah okay. In the future, I'll just open PRs when it's work I've done like this, then.