This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-02
Channels
- # announcements (4)
- # aws (18)
- # beginners (227)
- # boot (1)
- # calva (13)
- # cider (22)
- # clara (2)
- # cljs-dev (17)
- # clojure (85)
- # clojure-brasil (2)
- # clojure-dev (55)
- # clojure-europe (2)
- # clojure-italy (18)
- # clojure-japan (4)
- # clojure-losangeles (1)
- # clojure-nl (5)
- # clojure-uk (53)
- # clojurescript (46)
- # clojureverse-ops (8)
- # cursive (17)
- # data-science (3)
- # datascript (3)
- # datomic (25)
- # duct (4)
- # emacs (2)
- # figwheel-main (1)
- # fulcro (9)
- # hoplon (2)
- # hyperfiddle (1)
- # jobs-discuss (5)
- # kaocha (7)
- # leiningen (3)
- # nrepl (50)
- # off-topic (32)
- # portland-or (1)
- # re-frame (19)
- # reitit (2)
- # shadow-cljs (30)
- # spacemacs (2)
- # sql (8)
- # tools-deps (4)
- # vim (26)
- # xtdb (3)
- # yada (8)
I'm trying to get remote data working, and for some reason my ident is loading data into the proper place, but when the df/load function finishes the component does not update.
Loading function: (df/load this [:Editor/id id] Editor)
; Component :query [:Editor/id :Editor/content] :ident [:Editor/id :Editor/id]
I have verified that the data goes into the global db, but the component is never re-rendered.
@U5P29DSUS Is the this
you're using from the component ? Should refresh, if not worth adding a refresh with :Editor/id
to df load https://github.com/fulcrologic/fulcro/blob/develop/src/main/fulcro/client/data_fetch.cljc#L152 similar effect to http://book.fulcrologic.com/#_follow_on_reads
If you can copy paste the component and parent-component (just the declaration part) would also help debug the issue 🙂
The this
you are using for load might not be the one you want
The component code:
(fp/defsc Editor [this {:Editor/keys [id content] :as props}]
{:initial-state (fn [{:keys [id content]}] {:Editor/id id :Editor/content content})
:query [:Editor/id :Editor/content]
:ident [:Editor/id :Editor/id]}
(do
(println "editor content =" content "id =" id "allprops =" props)
(dom/textarea :.editor-textarea
{:value (if content content "")
:onClick (fn [e] (println "clicked" id)
(df/load this [:Editor/id id] Editor))
:key id})))
The parent call:
(e/ui-editor {:Editor/id 1})
. There is other stuff, but it seem. Which, now that I think about it, seems to be my issue. I need to pass in data to the editor from the db, right? I guess I thought for a bit that it was like a mutable component. Will try and let you know if that fixed it for me.@U5P29DSUS yep. You're parent component should compose the Editor in :query
and :initial-state
.