Skip to content

Commit

Permalink
Adding React Router
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorKGOW committed Apr 12, 2023
1 parent f445d0a commit 001ff1d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
39 changes: 39 additions & 0 deletions react_app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions react_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.10.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
13 changes: 10 additions & 3 deletions react_app/src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import {
BrowserRouter as Router,
Routes,
Route,
} from 'react-router-dom';
import './index.css';
import reportWebVitals from './reportWebVitals';
import IndexPage from './pages/IndexPage';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<IndexPage />
</React.StrictMode>
<Router>
<Routes>
<Route path="/" element={<IndexPage />} exact />
</Routes>
</Router>
);

// If you want to start measuring performance in your app, pass a function
Expand Down

0 comments on commit 001ff1d

Please sign in to comment.