added RouterLink component setup route system

This commit is contained in:
Maximus 2022-08-17 16:56:37 +03:00
parent 43163a19b2
commit fd3ef3fb9c
2 changed files with 17 additions and 10 deletions

View File

@ -0,0 +1 @@
export { NavLink as RouterLink } from "react-router-dom";

View File

@ -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