It’s my understanding that reitit
in Html5History
is adding a click EventListener
to the document
. I believe this was done so reitit
is agnostic of front end apps e.g. React, Vue etc. I was curious if anyone has replaced the push
behaviour stuffs inside the init
with a custom link
component to prevent the need to add a global event listener on the document? Any benefits? Example:
(defn link []
[:a {:on-click
(fn []
; prevent default
; check URL
; push state ...)}
...other stuffs])
So the above is doing something more akin to what ReactRouter does in their Link component.I am trying to replace the clicking of anchor tag with on-click of a span
[:a {:href (rfee/href :page {:id bid})} title]
to
[:span {:on-click (fn [e]
(rfee/href :page {:id bid}))}
title]
The reason I am trying to do this is because I want to handle nested links in the text for which I wanted to make changes
The anchor tag works but the on-click is not working
I am checking the event handlers which are registered in the browser on the span and I don't see any handler being registered
I was looking at https://purelyfunctional.tv/guide/re-frame-building-blocks/#introduction so the syntax seems correct
any plans to release a new version of reitit soon? Or any tips for an easy way to depend on a version from git with tools.deps? The latter isn’t so easy because of the lacking support for monorepos and java compilation in tools.deps afaik.
@mkvlr plan was to do small releases often. but there has been looming a breaking change with interceptors. It shipped today, so will push out release from all th relevant libs.
would be great to have deps for monorepos.
+1 on deps for monorepos
when depending on something without java sources https://github.com/nextjournal/reitit/commit/ad3773eac633f24cf68301b0e615630a808a2252 can be a workaround
Anyone using reitit with #luminus? How to I make a page say "/admin" to render a template say "admin.html", not "/#/admin(or about)" since I have two different templates and designs for home.html and admin.html each of which is using their own individual hiccup fns within core.cljs and should render those functions respectively within their templates