Fork me on GitHub

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.


Any ideas?


@U5P29DSUS Is the this you're using from the component ? Should refresh, if not worth adding a refresh with :Editor/id to df load similar effect to


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]}
    (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.