Skip to content

Commit

Permalink
React Router v6 applied
Browse files Browse the repository at this point in the history
  • Loading branch information
anijitsao committed Dec 30, 2021
1 parent 8febb98 commit 614dcd7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion public/dist/main.js

Large diffs are not rendered by default.

25 changes: 19 additions & 6 deletions public/dist/main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,30 @@ object-assign
@license MIT
*/

/** @license React v0.20.2
* scheduler.production.min.js
/**
* React Router DOM v6.2.1
*
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/** @license React v16.13.1
* react-is.production.min.js
/**
* React Router v6.2.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down
2 changes: 1 addition & 1 deletion public/dist/main.js.map

Large diffs are not rendered by default.

20 changes: 5 additions & 15 deletions public/src/components/MusicPanel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react"
import { BrowserRouter as Router, Route, Switch } from "react-router-dom"
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"
import axios from "axios"

// components
Expand Down Expand Up @@ -90,24 +90,14 @@ const MusicPanel = () => {
<Router>
<div className="music-panel">
<NavBar links={links} active={active} makeActiveLink={makeActiveLink} />
<Switch>
<Routes>
<Route
exact
path="/"
render={(props) => (
<SongsPanel
{...props}
songs={songs}
changeRating={changeRating}
/>
)}
element={<SongsPanel songs={songs} changeRating={changeRating} />}
/>

<Route
path="/topfive/"
render={(props) => <TopFivePanel songs={songs} />}
/>
</Switch>
<Route path="/topfive/" element={<TopFivePanel songs={songs} />} />
</Routes>
</div>
</Router>
)
Expand Down

0 comments on commit 614dcd7

Please sign in to comment.