This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-13
Channels
- # ai (5)
- # announcements (4)
- # babashka (34)
- # beginners (78)
- # biff (6)
- # calva (41)
- # cider (47)
- # clerk (1)
- # clj-commons (3)
- # clj-http (1)
- # clojure (72)
- # clojure-europe (51)
- # clojure-nl (1)
- # clojure-norway (87)
- # clojure-romania (1)
- # clojure-uk (5)
- # clojuredesign-podcast (2)
- # community-development (1)
- # conjure (2)
- # cursive (11)
- # datomic (6)
- # docker (4)
- # emacs (13)
- # exercism (20)
- # hyperfiddle (56)
- # matrix (6)
- # membrane (4)
- # nbb (11)
- # off-topic (88)
- # pathom (7)
- # pedestal (1)
- # polylith (20)
- # portal (16)
- # practicalli (1)
- # re-frame (13)
- # reagent (4)
- # reitit (2)
- # remote-jobs (7)
- # shadow-cljs (49)
- # sql (4)
how to switch the route in reagent project? i use lein new reagent app to create an app, i want to create button which will send a request to backend and switch route into route :app after it, how should i do?
(defn jump [to]
(session/update! :route
merge
{:current-page to}))
this one will change the app layout, but the url in location won't change, how should i to change the locationLSupposing :app
is located at /app
:
(defn jump [to]
(session/update! :route
merge
{:current-page to})
(.pushState (.-history js/window) nil "" "/app"))
This changes the URL to
(.pushState (.-history js/window) nil "" "/app")
should probably be done in the side-effecty function session/update!
I recommend a client-side routing solution like reitit
if you have a more complex app.❤️ 1