mirror of
https://github.com/asimonson1125/asimonson1125.github.io.git
synced 2026-02-25 05:09:49 -06:00
update to React 18
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "portfolio",
|
"name": "portfolio",
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"homepage": "https://www.asimonson.com/#/",
|
"homepage": ".",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@testing-library/jest-dom": "^5.16.4",
|
"@testing-library/jest-dom": "^5.16.4",
|
||||||
|
|||||||
15
src/App.js
15
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 './App.css';
|
||||||
import ReactGA from 'react-ga'
|
// import ReactGA from 'react-ga'
|
||||||
import Nav from './componets/Nav.js'
|
import Nav from './componets/Nav.js'
|
||||||
import Socials from './componets/Socials.js'
|
import Socials from './componets/Socials.js'
|
||||||
import Home from './pages/Home.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();
|
AOS.init();
|
||||||
function App() {
|
function App() {
|
||||||
ReactGA.initialize('G-E2V93W9CNV');
|
|
||||||
ReactGA.pageview('Init page view');
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Router>
|
<Router>
|
||||||
<div className="App">
|
<div className="App">
|
||||||
@@ -27,9 +24,11 @@ function App() {
|
|||||||
<Link to='/about'>About</Link>
|
<Link to='/about'>About</Link>
|
||||||
</Nav>
|
</Nav>
|
||||||
</div>
|
</div>
|
||||||
<Route exact path='/'><Home /></Route>
|
<Routes>
|
||||||
<Route exact path='/projects'><Projects /></Route>
|
<Route exact path='/' element={<Home />}></Route>
|
||||||
<Route exact path='/about'><AboutMe /></Route>
|
<Route exact path='/projects' element={<Projects />}></Route>
|
||||||
|
<Route exact path='/about' element={<AboutMe />}></Route>
|
||||||
|
</Routes>
|
||||||
<div className='footer'>
|
<div className='footer'>
|
||||||
<Socials />
|
<Socials />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
12
src/index.js
12
src/index.js
@@ -1,15 +1,17 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import { createRoot } from 'react-dom/client';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
import reportWebVitals from './reportWebVitals';
|
import reportWebVitals from './reportWebVitals';
|
||||||
import './responsive.js'
|
import './responsive.js'
|
||||||
|
|
||||||
ReactDOM.render(
|
const container = document.getElementById('root');
|
||||||
|
const root = createRoot(container);
|
||||||
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</React.StrictMode>,
|
</React.StrictMode>
|
||||||
document.getElementById('root')
|
);
|
||||||
);
|
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
// If you want to start measuring performance in your app, pass a function
|
||||||
// to log results (for example: reportWebVitals(console.log))
|
// to log results (for example: reportWebVitals(console.log))
|
||||||
|
|||||||
Reference in New Issue
Block a user