Open mamacdon opened 3 years ago
Hey,
if you have has: true
then your browser journey should start with /#/foo
. Also I like to think that the hash routing is more of a supportive feature. The main usage should not use hashes. That's because hashes (in general) have another purpose and also because history based routing is well supported.
I have the same problem (at least i think)
const router = new Navigo("/", { hash: true });
router.on({
"/about": function () {
console.log("about");
},
});
Clicking on a link to http://127.0.0.1:5500/#/about works fine, but when i reload the page, the callback function is not invoked.
Ahh sorry i missed the resolve part
router
.on({
about: function () {
console.log("about");
},
})
.resolve();
Working now
When running Navigo 7.1.2 as shown below:
… calling
resolve()
invoked my root handler:After I upgraded to v8.11.0, my code looks like this:
… but now the root handler is not called:
In v8,
resolve()
seems to match routes based on the pathname (/foo
). This strikes me as weird – withhash: true
, shouldn't Navigo route based on the hash only?