This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-10
Channels
- # beginners (35)
- # cider (165)
- # cljsrn (18)
- # clojars (1)
- # clojure (141)
- # clojure-greece (2)
- # clojure-italy (11)
- # clojure-nl (1)
- # clojure-spec (21)
- # clojure-uk (89)
- # clojurescript (56)
- # community-development (3)
- # cursive (3)
- # data-science (55)
- # datomic (13)
- # emacs (12)
- # fulcro (31)
- # graphql (6)
- # jobs-discuss (35)
- # lein-figwheel (10)
- # mount (2)
- # off-topic (3)
- # onyx (22)
- # parinfer (4)
- # portkey (7)
- # re-frame (29)
- # ring-swagger (4)
- # shadow-cljs (37)
- # specter (9)
- # sql (30)
- # tools-deps (15)
- # vim (2)
- # yada (17)
@oliver.mooney your ident functions and route instructions need to be consistent…you’ve used :profile
for the table name in the routing table, :PAGE/profile
in the router, and the the Profile page itself uses the destructured page (which is :PAGE/profile
). So, the error is in your routing tree instruction.
I should probably change defrouter
to generate a “default” route that shows this error better 🙂
how to add form config to a root ident? I tried all of the following, none worked:
(fs/add-form-config* MyFormComp [:my-root-key])
(fs/add-form-config* MyFormComp [:my-root-key '_])
(fs/add-form-config* MyFormComp :my-root-key)
@tony.kay that error-mode is much better thanks! I see "Cannot route: Unknown Screen" in my UI and no console error message, it's a much better hint
@myguidingstar I think {:my-root-key '_}
@thheller I literally meant '_
as it's the syntax for querying "links". You may have thought I use '_
as a placeholder for some properties, but it's not the case
after looking at the app state I guess the first one works. But I need to clean up the mess to confirm 😄
the book says a form component must have :ident, so my effort to use a root ident won't work
I'm trying to use root idents. Why does this print an empty map?
(defsc Root [this props]
{:initial-state (fn [params] {:user/whoami {:user/name "Guest"}})
:query [{[:user/whoami '_] [:user/name]}]}
(dom/div {}
(dom/div (str "user: " (pr-str props)))))
I expected it to print out "Guest"
@myguidingstar In general Root is a special node. It cannot have an ident, and link queries (which mean “jump back to root”) aren’t meant to be used there. The latter is technically a bug, but the workaround is so trivial that I have not bothered to fix it (when already in root change [:x '_]
to :x
).
It’s an artifact of the overall design that the Root shares the same space as all of the tables, and in general I recommend that you just create a root that “gets you to the app root” as quickly as possible 🙂
@oliver.mooney Thanks for checking
I see. Thanks
Hi Thắng. I wanted to let you know I haven’t forgotten about the real-world app. How is it going? The pressure’s increased on my project at work so I haven’t had much free time, but I should see a light at the end of the tunnel soon.
Actually I'm working on a fulcro version of it https://github.com/walkable-server/realworld-fulcro
I am using (dom/span #js {:style {:color "blue"}} (str "11111" name))
to color the text, but it is staying black. What is it that I am doing wrong?
@rudiwillalwaysloveyou if you just bump to 2.5+ you don't need the #js
at all
@wilkerlucio @cjmurphy I am doing the tutorial which is on an alpha version of 2.5 … Strangely enough adding the second #js solved the issue, and then removing them both worked fine as well (which I had tried first before adding the single #js). I have no idea why.
yeah, probably because of the conversion rules
if you used js on the first, it will not convert anything after that
but by sending a clojure map the macro will convert it at compile time to js recursively
@rudiwillalwaysloveyou The macro only does automatic conversion if you pass it a normal data struture. If it is already a js value, it assumes you know what you’re doing and works in bw compat mode