added RouterLink component setup route system
This commit is contained in:
parent
43163a19b2
commit
fd3ef3fb9c
1
src/components/typography/RouterLink.tsx
Normal file
1
src/components/typography/RouterLink.tsx
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { NavLink as RouterLink } from "react-router-dom";
|
@ -1,16 +1,22 @@
|
|||||||
import React from 'react';
|
import React from "react";
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from "react-dom/client";
|
||||||
import './index.css';
|
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
||||||
import App from './App';
|
import "./index.css";
|
||||||
import reportWebVitals from './reportWebVitals';
|
import App from "./App";
|
||||||
|
import reportWebVitals from "./reportWebVitals";
|
||||||
|
|
||||||
import "./localization/i18n";
|
import "./localization/i18n";
|
||||||
|
const rootElement = document.getElementById("root");
|
||||||
ReactDOM.render(
|
if (!rootElement) throw new Error("Failed to find the root element");
|
||||||
|
const root = ReactDOM.createRoot(rootElement);
|
||||||
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<BrowserRouter>
|
||||||
</React.StrictMode>,
|
<Routes>
|
||||||
document.getElementById('root')
|
<Route path="/" element={<App />}></Route>
|
||||||
|
</Routes>
|
||||||
|
</BrowserRouter>
|
||||||
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
// If you want to start measuring performance in your app, pass a function
|
||||||
|
Loading…
x
Reference in New Issue
Block a user