HomePhabricator

[Cashtab] Upgrade react-router-dom to latest version

Description

[Cashtab] Upgrade react-router-dom to latest version

Summary:
Upgrade react-router-dom from 5 to 6. Refactor for breaking changes.

Ref https://reactrouter.com/en/main/upgrading/v5#upgrade-to-react-router-v6

Background
This allows us to improve testing of routing and components, and allows us to get rid of the v5 router mock in all of our component tests

Test Plan:
npm test

Manual checks

  • Can copy an airdrop tx from airdrop screen to send screen
  1. Navigate to Airdrop screen
  2. Enter tokenId 50d8292c6255cda7afc6c8566fed3cf42a2794e9619740fe8f4c95431271410e
  3. Enter amount 5000
  4. Generate
  5. Click "Copy to send screen" -- you are taken to send screen and send to field is populated

other routing state links are tested in new AppIntegration.test.js tests

Also these manual tests:
Two areas that need to either be automated or manually tested:

  1. The routing from a token page to airdrop, ensuring token ID is propagated from SendToken.js to Airdrop.js
  2. When a token balance in the wallet is completely burned it routes back to the Home screen after burn tx broadcast notification

Reviewers: #bitcoin_abc, PiRK, emack

Reviewed By: #bitcoin_abc, PiRK, emack

Subscribers: emack

Differential Revision: https://reviews.bitcoinabc.org/D15379