From ca30af62586d06365681ec2eeba36e10ac383999 Mon Sep 17 00:00:00 2001 From: Andrew Simonson Date: Tue, 12 Apr 2022 11:02:29 -0400 Subject: [PATCH] update to React 18 --- package.json | 2 +- src/App.js | 15 +++++++-------- src/index.js | 12 +++++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 0937f42..05ad61c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "portfolio", "version": "0.2.0", - "homepage": "https://www.asimonson.com/#/", + "homepage": ".", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.4", diff --git a/src/App.js b/src/App.js index 9451d59..dce997a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,7 +1,7 @@ -import { Route, Link, HashRouter as Router } from 'react-router-dom' +import { Route, Link, Routes, HashRouter as Router } from 'react-router-dom' import './App.css'; -import ReactGA from 'react-ga' +// import ReactGA from 'react-ga' import Nav from './componets/Nav.js' import Socials from './componets/Socials.js' import Home from './pages/Home.js' @@ -12,9 +12,6 @@ import 'aos/dist/aos.css'; // You can also use for styles AOS.init(); function App() { - ReactGA.initialize('G-E2V93W9CNV'); - ReactGA.pageview('Init page view'); - return (
@@ -27,9 +24,11 @@ function App() { About
- - - + + }> + }> + }> +
diff --git a/src/index.js b/src/index.js index b3bf05b..fc04f26 100644 --- a/src/index.js +++ b/src/index.js @@ -1,15 +1,17 @@ import React from 'react'; -import ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import App from './App'; import reportWebVitals from './reportWebVitals'; import './responsive.js' -ReactDOM.render( +const container = document.getElementById('root'); +const root = createRoot(container); +root.render( - , - document.getElementById('root') -); + + ); + // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log))