feat: Router 추가
This commit is contained in:
parent
702dd2c204
commit
122681a76d
@ -1,5 +0,0 @@
|
||||
function App() {
|
||||
return <div>App</div>;
|
||||
}
|
||||
|
||||
export default App;
|
11
frontend/src/Router.jsx
Normal file
11
frontend/src/Router.jsx
Normal 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;
|
@ -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>
|
||||
);
|
||||
|
3
frontend/src/pages/HomePage/HomePage.jsx
Normal file
3
frontend/src/pages/HomePage/HomePage.jsx
Normal file
@ -0,0 +1,3 @@
|
||||
export default function Home() {
|
||||
return <div>Home</div>;
|
||||
}
|
1
frontend/src/pages/HomePage/index.js
Normal file
1
frontend/src/pages/HomePage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as Home } from './HomePage';
|
Loading…
Reference in New Issue
Block a user