mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 04:19:45 +00:00
Routing, contact-page
This commit is contained in:
1 parent
da7b415c1a
commit
4a00dbefc4
10 files changed
+121
-18
No files matched your search
+22
-3
@@ -1,13 +1,32 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import { createHashRouter, RouterProvider, Outlet } from 'react-router-dom';
|
||||
|
||||
import Root from './routes/Root';
|
||||
import ErrorPage from './error-page';
|
||||
import Contact from './routes/Contact';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
import './index.scss';
|
||||
|
||||
const router = createHashRouter([
|
||||
|
||||
{
|
||||
path: '/',
|
||||
element: <Root />,
|
||||
errorElement: <ErrorPage />,
|
||||
children: [
|
||||
{
|
||||
path: "/contact",
|
||||
element: <Contact />,
|
||||
},
|
||||
]
|
||||
},
|
||||
])
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
<RouterProvider router={router} />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user