fresh
fresh copied to clipboard
Feat: trigger partial route change from JS
I know about of partial and I applied the documentation fine, but in some cases I need change of page with logic(JS or TS) and I tried with window.location.href
, document.location.href
and location.href
but in all cases the change of pages refresh all website.
How I can change with JS of page like for example navigate(
/link/foo=bar);
from reactjs or with Router.push()
from nextjs
Also I tried with this code:
location.href = new URL(`/link/foo=bar`, location.origin).href;
But it doesn't work 😭
Client side routing is done via Partials in Fresh, see https://fresh.deno.dev/docs/concepts/partials
But only works with tag A and I could't see how use that with JS, if you know that please show me one example 🙏
Yeah it's currently limited to anchor tags and forms. There currently is no API to access it from JS.
Re-opening because a question turned into a feature request.
Yeah it's currently limited to anchor tags and forms. There currently is no API to access it from JS.
Re-opening because a question turned into a feature request.
When I was researching I saw this same problem in stackoverflow, reddit.
Yeah it's currently limited to anchor tags and forms. There currently is no API to access it from JS. Re-opening because a question turned into a feature request.
When I was researching I saw this same problem in stackoverflow, reddit.
I'm afraid I don't track those places. I mostly monitor this repository here or our discord.
+1