Fork me on GitHub
#rum
<
2018-06-28
>
grumplet14:06:22

Does anyone use antizer with rum? I’m looking for some help making an antd form reactive - i.e. I want its field values to update when they change in the db atom.

grumplet14:06:07

Also, how to initialise the form fields. I feel that (ant/create-form patient-form :props {:nhs-number "123456"}) should do something here…

grumplet14:06:05

Ah, I see that :nhs-number ends up in rum component state, rather than in the form field :nhs-number

grumplet14:06:47

Using this for initialisation:

(ant/form {:layout "horizontal"}
  (ant/form-item (labelled "NHS Number")
    (ant/decorate-field my-form "nhs-number" {:initial-value (:nhs-number state) } (ant/input))))

grumplet14:06:56

OK. That’ll do - I don’t need it to react, only to initialise from the database correctly.