Fork me on GitHub
#reagent
<
2017-09-14
>
tomaas07:09:47

hi, i'm getting this error Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- sass/util when running lein sass watch in my windows.

vinai09:09:11

I'm getting the warning > Warning: Accessing createClass via the main React package is deprecated, and will be removed in React v16.0. in the console. How do you handle that? Will there will be an update to cljsjs/react or reagent some time that will use the appropriate new react function?

juhoteperi10:09:29

@vinai Reagent is already updated, problem is in some other package (devcards, sablono, other react-* packages)

vinai10:09:10

Thanks for the reply @juhoteperi. Do you have an idea how to figure out which package might be causing the issue?

juhoteperi10:09:26

Stacktrace might show the file where createClass is being called

erwinrooijakkers14:09:06

When using Reagent, is there any use for placing a reaction around every query? Or only around the db? E.g.,

(defonce app-db
  (let [ratom (r/atom (d/db conn))]
    (add-watch conn :watch-conn (fn [_ _ _ new-db] (reset! ratom new-db)))
    ratom))
And then:
(let [screen-state (reaction (d/q '[:find (pull ?e [*]) .
                                      :where [?e :ui/screen-element :ui/page]]
                                    @app-db))] ... do something with @screen-state)
When the reaction around the query in screen-state is removed the behaviour does not seem to change.

erwinrooijakkers14:09:25

Does the reaction for screen-state do anything useful?

erwinrooijakkers14:09:20

To formulate it differently: does Reagent optimise for what parts of the app-db are changed?

erwinrooijakkers14:09:41

Or does it just re-render everything that makes use of app-db always?

erwinrooijakkers14:09:48

To answer my own questions: I think it makes sense to place reactions around it, since otherwise we rerender the whole page, and when reaction is available the component is shielded from a refresh