From 122681a76deb395d24375377fa7d16595b9eb98d Mon Sep 17 00:00:00 2001 From: jhynsoo Date: Fri, 12 Jul 2024 16:22:41 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Router=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.jsx | 5 ----- frontend/src/Router.jsx | 11 +++++++++++ frontend/src/main.jsx | 22 +++++++++++++++------- frontend/src/pages/HomePage/HomePage.jsx | 3 +++ frontend/src/pages/HomePage/index.js | 1 + 5 files changed, 30 insertions(+), 12 deletions(-) delete mode 100644 frontend/src/App.jsx create mode 100644 frontend/src/Router.jsx create mode 100644 frontend/src/pages/HomePage/HomePage.jsx create mode 100644 frontend/src/pages/HomePage/index.js diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx deleted file mode 100644 index 544badc..0000000 --- a/frontend/src/App.jsx +++ /dev/null @@ -1,5 +0,0 @@ -function App() { - return
App
; -} - -export default App; diff --git a/frontend/src/Router.jsx b/frontend/src/Router.jsx new file mode 100644 index 0000000..b86cf44 --- /dev/null +++ b/frontend/src/Router.jsx @@ -0,0 +1,11 @@ +import { createBrowserRouter } from 'react-router-dom'; +import { Home } from './pages/HomePage'; + +const router = createBrowserRouter([ + { + path: '/', + element: , + }, +]); + +export default router; diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index 54b39dd..aa1b3d9 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -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( - - , -) + + + + +); diff --git a/frontend/src/pages/HomePage/HomePage.jsx b/frontend/src/pages/HomePage/HomePage.jsx new file mode 100644 index 0000000..aa58832 --- /dev/null +++ b/frontend/src/pages/HomePage/HomePage.jsx @@ -0,0 +1,3 @@ +export default function Home() { + return
Home
; +} diff --git a/frontend/src/pages/HomePage/index.js b/frontend/src/pages/HomePage/index.js new file mode 100644 index 0000000..be9bd39 --- /dev/null +++ b/frontend/src/pages/HomePage/index.js @@ -0,0 +1 @@ +export { default as Home } from './HomePage';