feat: Router 추가

This commit is contained in:
jhynsoo 2024-07-12 16:22:41 +09:00
parent 702dd2c204
commit 122681a76d
5 changed files with 30 additions and 12 deletions

View File

@ -1,5 +0,0 @@
function App() {
return <div>App</div>;
}
export default App;

11
frontend/src/Router.jsx Normal file
View File

@ -0,0 +1,11 @@
import { createBrowserRouter } from 'react-router-dom';
import { Home } from './pages/HomePage';
const router = createBrowserRouter([
{
path: '/',
element: <Home />,
},
]);
export default router;

View File

@ -1,10 +1,18 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
import React from 'react';
import ReactDOM from 'react-dom/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { RouterProvider } from 'react-router-dom';
import router from './Router';
import './index.css';
const queryClient = new QueryClient({
defaultOptions: {},
});
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
<QueryClientProvider client={queryClient}>
<RouterProvider router={router} />
</QueryClientProvider>
</React.StrictMode>
);

View File

@ -0,0 +1,3 @@
export default function Home() {
return <div>Home</div>;
}

View File

@ -0,0 +1 @@
export { default as Home } from './HomePage';