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 ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import "./localization/i18n";
ReactDOM.render(
const rootElement = document.getElementById("root");
if (!rootElement) throw new Error("Failed to find the root element");
const root = ReactDOM.createRoot(rootElement);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
<BrowserRouter>
<Routes>
<Route path="/" element={<App />}></Route>
</Routes>
</BrowserRouter>
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function