@@ -17,6 +17,7 @@
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
+ "react-router-dom": "^6.7.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
@@ -0,0 +1,19 @@
+import React from "react";
+import { useHistory } from "react-router-dom";
+
+const DetailPage = () => {
+ const history = useHistory();
+ const HomePage = () => {
+ history.push("/");
+ }
+ return (
+ <>
+ <button onClick={HomePage}>Back to home page</button>
+ </>
+ )
+}
+export {
+ DetailPage
@@ -0,0 +1,25 @@
+const HomePage = () => {
+ const DetailPage = () => {
+ history.push("/detail");
+ <h1>Home Page</h1>
+ {/* Loop to go through the queues array */}
+ );
+ HomePage