From 0cc307f406aec235ac40891835900945030aa028 Mon Sep 17 00:00:00 2001 From: Malik M Alnakhaleh Date: Mon, 23 Dec 2024 16:22:21 -0500 Subject: [PATCH] remove superfluous #/ at the end of link. Ran into a similar issue where I work with the URL of the page has a superfluous #/ at the end of it. This change should remove that before the page is rendered. --- src/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.js b/src/index.js index 1384c20..1fe0b52 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,9 @@ import App from './App'; import Blog from './Blog'; import reportWebVitals from './reportWebVitals'; +if (window.location.hash.startsWith('#/')) { + window.location.replace(window.location.toString().replace('#/', '')); +} const root = ReactDOM.createRoot(document.getElementById('root')); root.render(