secretary icon indicating copy to clipboard operation
secretary copied to clipboard

Can't define a route with query parameters.

Open crimsonhawk47 opened this issue 2 years ago • 1 comments

I receive this error in the javascript console (picture attached).

(defroute "/details/:id" {:as params}
  (render-details-page (:id params)))

image

This error happens even if I just take out the (:id params) part and just render a random component.

crimsonhawk47 avatar Nov 20 '22 09:11 crimsonhawk47

if you want to use the id and query parameters of the page then do something like this

(defroute "/details/:id" [id query-params]
  (render-details-page (id query-params)))

devasiajoseph avatar Aug 17 '24 18:08 devasiajoseph