Skip to content
Snippets Groups Projects
Commit 794d9d84 authored by Jorik Schellekens's avatar Jorik Schellekens
Browse files

hacky fix infinite loop

parent cf23f0a8
Branches
Tags 1.0.0 1.0.1
No related merge requests found
...@@ -36,13 +36,18 @@ const App: React.FC = () => { ...@@ -36,13 +36,18 @@ const App: React.FC = () => {
</> </>
); );
// Some hacky uri decoding
location.href = decodeURIComponent(location.href);
const [hash, setHash] = useState(location.hash); const [hash, setHash] = useState(location.hash);
console.log(hash); console.log(hash);
useEffect(() => (window.onhashchange = () => setHash(location.hash)), []); useEffect(() => {
// Some hacky uri decoding
if (location.href.split('/').length > 4) {
location.href = decodeURIComponent(location.href);
}
window.onhashchange = () => setHash(location.hash);
console.log('why');
}, []);
if (hash) { if (hash) {
if (hash.startsWith('#/')) { if (hash.startsWith('#/')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment