Compare commits

..

No commits in common. "a8fcb17ce10894445173b02ceed9a08c6dad629a" and "5cfabc5fd133848d16d5876a579b7ee93720b731" have entirely different histories.

8 changed files with 3 additions and 47 deletions

View File

@ -10,11 +10,9 @@
"preview": "vite preview"
},
"dependencies": {
"@types/react-router-dom": "^5.3.3",
"axios": "^1.7.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.23.1"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.66",

View File

@ -1,17 +1,8 @@
import { useState } from 'react'
import axios from 'axios'
import { useLayoutEffect, useState } from 'react'
import './App.css'
const [token, setToken] = useState("")
const API = axios.create({
baseURL: "http://localhost:3000/",
headers: {
"Content-Type": "application/json; charset=UTF-8",
"Authorization": "secret_token " + token
}
})
function App() {
const [token, setToken] = useState("")
return (
<>

View File

@ -1,16 +0,0 @@
import { useRouteError } from "react-router-dom";
export default function ErrorPage() {
const error: any = useRouteError();
console.error(error);
return (
<div id="error-page">
<h1>Oops!</h1>
<p>Sorry, an unexpected error has occurred.</p>
<p>
<i>{error.statusText || error.message}</i>
</p>
</div>
);
}

View File

@ -1,19 +1,7 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import App from './App.tsx'
import './index.css'
import Root from './routes/root.tsx'
import ErrorPage from './error-page.tsx'
const router = createBrowserRouter([
{
path: "/",
element: < Root />,
errorElement: <ErrorPage />
},
]);
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>

View File

View File

@ -1,5 +0,0 @@
export default function Root() {
return <>
<h1>Hello!</h1>
</>
}

View File

View File