Fork me on GitHub
#re-frame
<
2020-05-21
>
nprbst00:05:52

Ahhh...things are starting to come into focus. Thank you. That helped.

kirill.salykin15:05:28

Hi I am implementing form each field of the form has a sub (generalized)

(rf/reg-sub :form/field
            (fn [db [_ form-id field]]
              (get-in db [:form/form form-id :fields field])))
On render, field sub derefed and used like this
(let {:keys [value error touched?]} @(rf/subscribe [:form/field form-id name])
<hiccup>)
but every field is re-rendered on change of one field (eg if you change email both email and password will be rerendered) is it something expected ? is it possible that only changed field is rerendered? thanks

mikethompson21:05:08

@kirill.salykin Given the snippet provided, I wouldn't expect all fields to get re-rendered

mikethompson21:05:41

Is each field in its own component?

kirill.salykin21:05:26

no, it is not... clear, thanks!