Skip to content

Commit 4531164

Browse files
committed
Updated App.jsx to support react-router-dom version 6
1 parent 6183c2b commit 4531164

File tree

3 files changed

+32
-112
lines changed

3 files changed

+32
-112
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"react": "^17.0.0",
1111
"react-dom": "^17.0.0",
12-
"react-router-dom": "^5.3.0"
12+
"react-router-dom": "^6.3.0"
1313
},
1414
"devDependencies": {
1515
"@tailwindcss/jit": "^0.1.18",

src/App.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import React from 'react';
22
import Navbar from './components/Navbar';
3-
import {BrowserRouter, Switch, Route } from 'react-router-dom';
3+
import {BrowserRouter as Router, Routes, Route } from 'react-router-dom';
44
import Home from './pages/Home';
55
import About from './pages/About';
66

77
function App() {
88
return (
9-
<BrowserRouter>
9+
<Router>
1010
<div className="pt-20">
1111
<Navbar />
12-
<Switch>
13-
<Route path="/" component={Home} exact />
14-
<Route path="/about" component={About} exact />
15-
</Switch>
12+
<Routes>
13+
<Route path="/" element={<Home />}/>
14+
<Route path="/about" element={<About />} />
15+
</Routes>
1616
</div>
17-
</BrowserRouter>
17+
</Router>
1818
)
1919
}
2020

yarn.lock

Lines changed: 24 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@
188188
dependencies:
189189
"@babel/helper-plugin-utils" "^7.14.5"
190190

191-
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13":
192-
version "7.15.4"
193-
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
194-
integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==
191+
"@babel/runtime@^7.7.6":
192+
version "7.18.0"
193+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.0.tgz#6d77142a19cb6088f0af662af1ada37a604d34ae"
194+
integrity sha512-YMQvx/6nKEaucl0MY56mwIG483xk8SDNdlUwb2Ts6FUpr7fm85DxEmsY18LXBNhcTz6tO6JwZV8w1W06v8UKeg==
195195
dependencies:
196196
regenerator-runtime "^0.13.4"
197197

@@ -716,24 +716,12 @@ hex-color-regex@^1.1.0:
716716
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
717717
integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==
718718

719-
history@^4.9.0:
720-
version "4.10.1"
721-
resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
722-
integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==
723-
dependencies:
724-
"@babel/runtime" "^7.1.2"
725-
loose-envify "^1.2.0"
726-
resolve-pathname "^3.0.0"
727-
tiny-invariant "^1.0.2"
728-
tiny-warning "^1.0.0"
729-
value-equal "^1.0.1"
730-
731-
hoist-non-react-statics@^3.1.0:
732-
version "3.3.2"
733-
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
734-
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
719+
history@^5.2.0:
720+
version "5.3.0"
721+
resolved "https://registry.yarnpkg.com/history/-/history-5.3.0.tgz#1548abaa245ba47992f063a0783db91ef201c73b"
722+
integrity sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==
735723
dependencies:
736-
react-is "^16.7.0"
724+
"@babel/runtime" "^7.7.6"
737725

738726
hsl-regex@^1.0.0:
739727
version "1.0.0"
@@ -855,11 +843,6 @@ is-number@^7.0.0:
855843
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
856844
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
857845

858-
isarray@0.0.1:
859-
version "0.0.1"
860-
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
861-
integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
862-
863846
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
864847
version "4.0.0"
865848
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -911,7 +894,7 @@ lodash@^4.17.21:
911894
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
912895
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
913896

914-
loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
897+
loose-envify@^1.1.0:
915898
version "1.4.0"
916899
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
917900
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -931,14 +914,6 @@ micromatch@^4.0.4:
931914
braces "^3.0.1"
932915
picomatch "^2.2.3"
933916

934-
mini-create-react-context@^0.4.0:
935-
version "0.4.1"
936-
resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e"
937-
integrity sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==
938-
dependencies:
939-
"@babel/runtime" "^7.12.1"
940-
tiny-warning "^1.0.3"
941-
942917
minimatch@^3.0.4:
943918
version "3.0.4"
944919
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
@@ -1042,13 +1017,6 @@ path-parse@^1.0.6:
10421017
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
10431018
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
10441019

1045-
path-to-regexp@^1.7.0:
1046-
version "1.8.0"
1047-
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a"
1048-
integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==
1049-
dependencies:
1050-
isarray "0.0.1"
1051-
10521020
path-type@^4.0.0:
10531021
version "4.0.0"
10541022
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
@@ -1115,15 +1083,6 @@ pretty-hrtime@^1.0.3:
11151083
resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1"
11161084
integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=
11171085

1118-
prop-types@^15.6.2:
1119-
version "15.7.2"
1120-
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
1121-
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
1122-
dependencies:
1123-
loose-envify "^1.4.0"
1124-
object-assign "^4.1.1"
1125-
react-is "^16.8.1"
1126-
11271086
purgecss@^4.0.3:
11281087
version "4.0.3"
11291088
resolved "https://registry.yarnpkg.com/purgecss/-/purgecss-4.0.3.tgz#8147b429f9c09db719e05d64908ea8b672913742"
@@ -1153,44 +1112,25 @@ react-dom@^17.0.0:
11531112
object-assign "^4.1.1"
11541113
scheduler "^0.20.2"
11551114

1156-
react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
1157-
version "16.13.1"
1158-
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
1159-
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
1160-
11611115
react-refresh@^0.10.0:
11621116
version "0.10.0"
11631117
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.10.0.tgz#2f536c9660c0b9b1d500684d9e52a65e7404f7e3"
11641118
integrity sha512-PgidR3wST3dDYKr6b4pJoqQFpPGNKDSCDx4cZoshjXipw3LzO7mG1My2pwEzz2JVkF+inx3xRpDeQLFQGH/hsQ==
11651119

1166-
react-router-dom@^5.3.0:
1167-
version "5.3.0"
1168-
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.3.0.tgz#da1bfb535a0e89a712a93b97dd76f47ad1f32363"
1169-
integrity sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==
1170-
dependencies:
1171-
"@babel/runtime" "^7.12.13"
1172-
history "^4.9.0"
1173-
loose-envify "^1.3.1"
1174-
prop-types "^15.6.2"
1175-
react-router "5.2.1"
1176-
tiny-invariant "^1.0.2"
1177-
tiny-warning "^1.0.0"
1178-
1179-
react-router@5.2.1:
1180-
version "5.2.1"
1181-
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.1.tgz#4d2e4e9d5ae9425091845b8dbc6d9d276239774d"
1182-
integrity sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==
1183-
dependencies:
1184-
"@babel/runtime" "^7.12.13"
1185-
history "^4.9.0"
1186-
hoist-non-react-statics "^3.1.0"
1187-
loose-envify "^1.3.1"
1188-
mini-create-react-context "^0.4.0"
1189-
path-to-regexp "^1.7.0"
1190-
prop-types "^15.6.2"
1191-
react-is "^16.6.0"
1192-
tiny-invariant "^1.0.2"
1193-
tiny-warning "^1.0.0"
1120+
react-router-dom@^6.3.0:
1121+
version "6.3.0"
1122+
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.3.0.tgz#a0216da813454e521905b5fa55e0e5176123f43d"
1123+
integrity sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw==
1124+
dependencies:
1125+
history "^5.2.0"
1126+
react-router "6.3.0"
1127+
1128+
react-router@6.3.0:
1129+
version "6.3.0"
1130+
resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.3.0.tgz#3970cc64b4cb4eae0c1ea5203a80334fdd175557"
1131+
integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==
1132+
dependencies:
1133+
history "^5.2.0"
11941134

11951135
react@^17.0.0:
11961136
version "17.0.2"
@@ -1230,11 +1170,6 @@ resolve-from@^5.0.0:
12301170
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
12311171
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
12321172

1233-
resolve-pathname@^3.0.0:
1234-
version "3.0.0"
1235-
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
1236-
integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==
1237-
12381173
resolve@^1.20.0:
12391174
version "1.20.0"
12401175
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
@@ -1366,16 +1301,6 @@ tailwindcss@^2.2.14:
13661301
resolve "^1.20.0"
13671302
tmp "^0.2.1"
13681303

1369-
tiny-invariant@^1.0.2:
1370-
version "1.1.0"
1371-
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"
1372-
integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==
1373-
1374-
tiny-warning@^1.0.0, tiny-warning@^1.0.3:
1375-
version "1.0.3"
1376-
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
1377-
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
1378-
13791304
tmp@^0.2.1:
13801305
version "0.2.1"
13811306
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14"
@@ -1405,11 +1330,6 @@ util-deprecate@^1.0.2:
14051330
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
14061331
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
14071332

1408-
value-equal@^1.0.1:
1409-
version "1.0.1"
1410-
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c"
1411-
integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==
1412-
14131333
vite@^2.5.4:
14141334
version "2.5.6"
14151335
resolved "https://registry.yarnpkg.com/vite/-/vite-2.5.6.tgz#51431bb5b99b041289595300ba15947bad0f89aa"

0 commit comments

Comments
 (0)