Hey guys, I'm looking for a super simple way to do routing in Reagent? I don't know much about how routes work. I know that usually in HTML I would just have my hyperlinks point to a relative link in my directory structure. In reagent, since it's single page, it won't do that. I looked at a library called reitit, but it seems a bit too complicated. Also, what are some complications when it comes to SPA routing? I know history is something I might want to play with, but otherwise I can't think of anything else. How can I change which view is active when I click on a hyperlink? Also, would this be better asked in beginners? Here's me repo: https://gitlab.com/wildwestrom/mysite
> I looked at a library called reitit, but it seems a bit too complicated https://gist.github.com/athomasoriginal/eadc022482c3432943c400cc8eeb1788 I setup to show someone else how to do this:
> what are some complications when it comes to SPA routing? Watch out for scroll position and redirect. You may not run into them, but just in case. Each are straightforward to resolve, the tricky part can be identifying them.
> How can I change which view is active when I click on a hyperlink? The gist should cover that
If you do go with reitit, which I recommend, they have several front end specific examples for routing.
@c.westrom ^^ Hope it helps π
that gist is great! wish they'd put something like that in the docs
Something really close to that gist is in the reitit-fronted docs ... I donβt think it makes sense for reagent to have it on their docs: https://github.com/metosin/reitit/blob/master/examples/frontend/src/frontend/core.cljs
my apologies, I meant the reitit docs. the section on "frontend" isn't super clear: https://cljdoc.org/d/metosin/reitit/0.5.12/doc/frontend
this is straying into #reitit territory tho
They do have examples like this, but the one I provided is diving concerns in a different way https://github.com/metosin/reitit/tree/master/examples/frontend
i saw that! thank you
No problem! Just wanted to give them credit also and promote visibility π UPDATE: haha I should just read the rest of the posts π