From 4b91c51452abdf396cd3256f007ee42ad3ba951a Mon Sep 17 00:00:00 2001 From: reZach Date: Mon, 4 Jul 2022 23:24:22 -0500 Subject: [PATCH] upgrade react to v18 --- app/src/core/nav.jsx | 15 +- app/src/core/root.jsx | 10 +- app/src/core/routes.jsx | 24 +- app/src/index.tsx | 13 +- app/src/redux/reducers/rootReducer.js | 20 - app/src/redux/store/store.js | 46 +- package-lock.json | 8626 ++++++------------------- package.json | 17 +- 8 files changed, 2211 insertions(+), 6560 deletions(-) delete mode 100644 app/src/redux/reducers/rootReducer.js diff --git a/app/src/core/nav.jsx b/app/src/core/nav.jsx index 8e416b6..bd62004 100644 --- a/app/src/core/nav.jsx +++ b/app/src/core/nav.jsx @@ -1,5 +1,6 @@ import React from "react"; import ROUTES from "Constants/routes"; +import { useNavigate } from "react-router-dom"; import { validateLicenseRequest, validateLicenseResponse, @@ -9,7 +10,6 @@ class Nav extends React.Component { constructor(props) { super(props); - this.history = props.history; this.state = { mobileMenuActive: false, licenseModalActive: false, @@ -59,13 +59,13 @@ class Nav extends React.Component { }); } - toggleMenu(event) { + toggleMenu(_event) { this.setState({ mobileMenuActive: !this.state.mobileMenuActive, }); } - toggleLicenseModal(event) { + toggleLicenseModal(_event) { const previous = this.state.licenseModalActive; // Only send license request if the modal @@ -88,7 +88,7 @@ class Nav extends React.Component { mobileMenuActive: false, }, function () { - this.history.push(url); + this.props.navigate(url); } ); } @@ -249,4 +249,9 @@ class Nav extends React.Component { } } -export default Nav; +function WithNavigate(props){ + const navigate = useNavigate(); + return