From fd3ef3fb9c7f821238949825dfa086bdb04f6465 Mon Sep 17 00:00:00 2001 From: Maximus Date: Wed, 17 Aug 2022 16:56:37 +0300 Subject: [PATCH] added RouterLink component setup route system --- src/components/typography/RouterLink.tsx | 1 + src/index.tsx | 26 +++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 src/components/typography/RouterLink.tsx diff --git a/src/components/typography/RouterLink.tsx b/src/components/typography/RouterLink.tsx new file mode 100644 index 0000000..2b03587 --- /dev/null +++ b/src/components/typography/RouterLink.tsx @@ -0,0 +1 @@ +export { NavLink as RouterLink } from "react-router-dom"; diff --git a/src/index.tsx b/src/index.tsx index 67c9221..df65e1b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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( - - , - document.getElementById('root') + + + }> + + + ); // If you want to start measuring performance in your app, pass a function