Fork me on GitHub
#helix
<
2023-07-24
>
tianshu20:07:44

Hey, new to helix. How do you guys configure your editor to indent the code properly? I'm using Emacs

hifumi12320:07:36

CIDER had a bug where indent metadata in ClojureScript macros wasn’t being respected. It should be fixed as of https://github.com/clojure-emacs/cider-nrepl/pull/785

tianshu20:07:38

Hmmm, I see.

tianshu20:07:08

Which route library is preferred to use with? reitit or react-router?

hifumi12321:07:51

You can use whichever you prefer. I use reitit, but I have heard of people using react-router as well

hifumi12321:07:33

e.g. if you want to use react-router, you can use it like this

(ns 
  (:require [helix.core :refer [$ defnc]]
            ["react-router-dom" :refer [BrowserRouter Route Switch]]))

(defnc app []
  ($ BrowserRouter    
     ($ Switch
        ($ Route {:path "/"} ($ home))
        ($ Route {:path "/:user"} ($ user))
        ($ Route ($ not-found)))))

👍 2
tianshu22:07:03

Thank you! I just tweaked my reitit setup, and it works