Closed maubut closed 3 years ago
Hello,
I need to make a document.location.href for a specific case. Reading the documentation, I understand that I should use the HIGHWAY.redirect(href).
However, on my side, the highway.redirect(href) just doesn't work. A ''highway_1.default.redirect is not a function'' error occurs.
Here is the code snippet of my default-renderer.ts:
import Highway from '@dogstudio/highway'; import DefaultRenderer from '../custom-renderer'; class FrontpageRenderer extends DefaultRenderer { ... onEnter() { const cards = Array.from(document.querySelectorAll('.artist-box')); for (const card of cards) { const link = card.querySelector('.view-artist')?.getAttribute('href'); (card as HTMLElement).onclick = (e) => { Highway.redirect(link); e.preventDefault(); } } } ... }
It must have something with my understanding but do you have any ideas?
How can I remove this issue, I'm feeling a little awkward right now!
I'm migrating my code from Barba to highway and I was just currently calling the redirect() method the wrong way...
Hello,
I need to make a document.location.href for a specific case. Reading the documentation, I understand that I should use the HIGHWAY.redirect(href).
However, on my side, the highway.redirect(href) just doesn't work. A ''highway_1.default.redirect is not a function'' error occurs.
Here is the code snippet of my default-renderer.ts:
It must have something with my understanding but do you have any ideas?