Fork me on GitHub

I'm just speculating, but could it be that regent/react won't update :value of an input box if you had interacted with it? I would imagine that one atom people would be annoyed with their form fields changing all the time.


@tkircsi Are you saying that the price updates but it isn’t formatted?


also: a couple of tips to make this code less complex: (1) instead of passing the item by value on line 52, then creating local ratom for price on 14, you should pass a reagent/cursor to the shopping-item component like so [shopping-item (reagent/cursor shoppinglist [(:id item)])]. Then you can just update the cursor and your main state atom will get updated automatically. (2) if you don’t want to do that, you can rewrite (update-item! assoc id (assoc {} :id id :name name :price (js/parseInt @rprice))) like this (update-item! assoc-in [id :price] (js/parseInt @rprice)) — generally speaking get-in and assoc-in make dealing with nested data easier (and eventually you might want to graduate to the specter library, though there’s a little bit of a ramp-up to learn how to use it)