From d5b81c5f2d69ad2b3daa20180a48b8a57413965c Mon Sep 17 00:00:00 2001 From: Nejc Date: Thu, 26 May 2022 21:29:28 +0200 Subject: [PATCH 1/9] Change routing ro react-location & setup devtools --- package.json | 8 +- src/App.tsx | 11 +- src/components/partials/Header/Header.tsx | 2 +- src/index.tsx | 5 +- src/pages/Home/Home.tsx | 4 +- src/routes/Routes.tsx | 56 +- yarn.lock | 2686 +++++++++++---------- 7 files changed, 1494 insertions(+), 1278 deletions(-) diff --git a/package.json b/package.json index 5379dad..bde871f 100644 --- a/package.json +++ b/package.json @@ -19,12 +19,14 @@ "code:check": "prettier --check \"src/**/*.{ts,tsx,js,css,scss,html}\"", "code:format": "prettier --write \"src/**/*.{ts,tsx,js,css,scss,html}\"", "code:format:specific-file": "prettier --write", - "lint": "eslint .", - "lint:fix": "eslint --fix ." + "lint": "eslint .", + "lint:fix": "eslint --fix ." }, "dependencies": { "@hookform/resolvers": "^2.8.8", "@material-ui/core": "^4.12.4", + "@tanstack/react-location": "^3.7.4", + "@tanstack/react-location-devtools": "^3.4.4", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.0.0", "@testing-library/react-hooks": "^8.0.0", @@ -42,7 +44,6 @@ "react": "^18.0.0", "react-dom": "^18.0.0", "react-hook-form": "^7.29.0", - "react-router-dom": "^6.3.0", "react-scripts": "5.0.0", "styled-components": "^5.3.5", "typescript": "^4.6.3", @@ -51,7 +52,6 @@ }, "devDependencies": { "@types/classnames": "^2.3.1", - "@types/react-router-dom": "^5.3.3", "@types/styled-components": "^5.1.25", "@types/yup": "^0.29.13", "@typescript-eslint/eslint-plugin": "^5.18.0", diff --git a/src/App.tsx b/src/App.tsx index a7c48cf..25029ee 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,17 +1,20 @@ import { FC } from 'react' +import { Router, Outlet } from '@tanstack/react-location' +import { ReactLocationDevtools } from '@tanstack/react-location-devtools' //Partials import Header from './components/partials/Header/Header' import Footer from './components/partials/Footer/Footer' -import Routes from './routes/Routes' +import { routes, location } from './routes/Routes' const App: FC = () => { return ( - <> +
- +