Fork me on GitHub
Aleksander Rendtslev17:03:38

Am I using dr/change-route! wrong? Here’s what I’m doing:

;; Where I do it:
(dr/change-route! this (dr/path-to TagPage "my-id"))

;; My component
(defsc TagPage [this {:keys [node/id] :as rest}]
  {:ident :node/id
   :query [:node/id :node/name]
   :initial-state (fn [{:node/keys [id]}]
                    {:node/id id
                     :node/name ""})
   :route-segment ["page" :node-id]
   :will-enter (fn [_app {:keys [node-id]}]
                 (log/info "Here it is: " node-id)
                 (dr/route-immediate [:node/id node-id]))}
  ;; Render logic

;; The warning I'm getting:
[com.fulcrologic.fulcro.algorithms.indexing:103] - component .../TagPage's ident ([:node/id nil]) has a `nil` second element. This warning can be safely ignored if that is intended. Props were [:node/id "my-id"]
It seems like it’s giving the component the parameters [:node/id "my-id"] as opposed to {:node/id "my-id"} I can’t figure out why?