update to React 18

This commit is contained in:
2022-04-12 11:02:29 -04:00
parent 80c612f679
commit ca30af6258
3 changed files with 15 additions and 14 deletions

View File

@@ -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",

View File

@@ -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 <link> for styles
AOS.init();
function App() {
ReactGA.initialize('G-E2V93W9CNV');
ReactGA.pageview('Init page view');
return (
<Router>
<div className="App">
@@ -27,9 +24,11 @@ function App() {
<Link to='/about'>About</Link>
</Nav>
</div>
<Route exact path='/'><Home /></Route>
<Route exact path='/projects'><Projects /></Route>
<Route exact path='/about'><AboutMe /></Route>
<Routes>
<Route exact path='/' element={<Home />}></Route>
<Route exact path='/projects' element={<Projects />}></Route>
<Route exact path='/about' element={<AboutMe />}></Route>
</Routes>
<div className='footer'>
<Socials />
</div>

View File

@@ -1,16 +1,18 @@
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(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals