From cda254ab37083462a1abb5b9bdd19d97cf88125b Mon Sep 17 00:00:00 2001 From: Tulio Miranda Date: Wed, 14 Aug 2024 13:33:40 -0300 Subject: [PATCH] feat: Upgrades router to v5 (#289) * feat: new root for React 18 * feat: router v5 * refactor: removes unused constant --- package-lock.json | 64 +++++++++++++++++------------------------------ package.json | 2 +- src/constants.js | 5 ---- src/index.js | 9 ++++--- 4 files changed, 29 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index dad3bb44..96e793e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "react-loading": "2.0.3", "react-paginate": "8.2.0", "react-redux": "8.1.3", - "react-router-dom": "4.2.2", + "react-router-dom": "5.3.4", "react-scripts": "3.4.4", "redux": "4.2.1", "sass": "1.77.8", @@ -19074,51 +19074,41 @@ } }, "node_modules/react-router": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-4.3.1.tgz", - "integrity": "sha512-yrvL8AogDh2X42Dt9iknk4wF4V8bWREPirFfS9gLU1huk6qK41sg7Z/1S81jjTrGHxa3B8R3J6xIkDAA6CVarg==", + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", + "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", "dependencies": { - "history": "^4.7.2", - "hoist-non-react-statics": "^2.5.0", - "invariant": "^2.2.4", + "@babel/runtime": "^7.12.13", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", "loose-envify": "^1.3.1", "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.1", - "warning": "^4.0.1" + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" }, "peerDependencies": { "react": ">=15" } }, "node_modules/react-router-dom": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-4.2.2.tgz", - "integrity": "sha512-cHMFC1ZoLDfEaMFoKTjN7fry/oczMgRt5BKfMAkTu5zEuJvUiPp1J8d0eXSVTnBh6pxlbdqDhozunOOLtmKfPA==", + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", + "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", "dependencies": { - "history": "^4.7.2", - "invariant": "^2.2.2", + "@babel/runtime": "^7.12.13", + "history": "^4.9.0", "loose-envify": "^1.3.1", - "prop-types": "^15.5.4", - "react-router": "^4.2.0", - "warning": "^3.0.0" + "prop-types": "^15.6.2", + "react-router": "5.3.4", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" }, "peerDependencies": { "react": ">=15" } }, - "node_modules/react-router/node_modules/hoist-non-react-statics": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz", - "integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==" - }, - "node_modules/react-router/node_modules/warning": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", - "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/react-scripts": { "version": "3.4.4", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-3.4.4.tgz", @@ -21862,9 +21852,9 @@ "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" }, "node_modules/tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" }, "node_modules/tiny-warning": { "version": "1.0.3", @@ -23218,14 +23208,6 @@ "makeerror": "1.0.12" } }, - "node_modules/warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha512-jMBt6pUrKn5I+OGgtQ4YZLdhIeJmObddh6CsibPxyQ5yPZm1XExSyzC1LCNX7BzhxWgiHmizBWJTHJIjMjTQYQ==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/watchpack": { "version": "1.7.5", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", diff --git a/package.json b/package.json index ee01541b..cb8d5375 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "react-loading": "2.0.3", "react-paginate": "8.2.0", "react-redux": "8.1.3", - "react-router-dom": "4.2.2", + "react-router-dom": "5.3.4", "react-scripts": "3.4.4", "redux": "4.2.1", "sass": "1.77.8", diff --git a/src/constants.js b/src/constants.js index 8a1996c0..8d561265 100644 --- a/src/constants.js +++ b/src/constants.js @@ -61,11 +61,6 @@ export const MAX_GRAPH_LEVEL = 1 // First bit in the index byte indicates whether it's an authority output export const TOKEN_AUTHORITY_MASK = 0b10000000 -/** - * Hathor token default index - */ -export const HATHOR_TOKEN_INDEX = 0; - export const GTM_ID = process.env.REACT_APP_GTM_ID; export const NFT_MEDIA_TYPES = { diff --git a/src/index.js b/src/index.js index 444a1ef5..de7286b7 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import App from './App'; import FlagProvider from '@unleash/proxy-client-react'; @@ -19,11 +19,12 @@ import store from "./store/index"; import { Provider } from "react-redux"; import { UNLEASH_CONFIG } from './constants'; -ReactDOM.render( +const container = document.getElementById('root'); +const root = createRoot(container); +root.render( - , - document.getElementById('root') + );