Fork me on GitHub
#reagent
<
2018-03-05
>
fabrao02:03:33

Hello all, how to I update the atom value for input in :on-change in (let [store (reagent/atom {:field_1 "", :field_2 ""})] :on-change #(swap! store assoc :field_1 (-> % .-target .-value)) -> this is not working, why?

fabrao03:03:06

@gadfly361 I´m doing exactly what I have not to do 🙂

fabrao03:03:21

I don´t know why but it worked

roti08:03:00

@lee.justin.m my question was, when processing an array (the output of a form-1 render function) and encountering something that is not a keyword, but a function, how does reagent know that it needs to render an already exiting component, or create a new one (effectively reinitializing it)?

Shaitan19:03:00

what version added [:> ?

mattboehm21:03:11

I'm trying to make a <use xlink:href="#foo" /> tag in reagent, but having trouble to get the attribute to show up. Any thoughts? currently trying [:use {(keyword "xlink:href") "#foo"}]

justinlee21:03:05

@mattboehm i think that’s just a react quirk

justinlee21:03:38

that suggests you have to {:xlinkHref "#foo"}

mattboehm21:03:52

thanks, I'll give it a try!

mattboehm22:03:57

That still wasn't doing it, but just using href works; thanks again

justinlee22:03:45

cool. as a general rule, react silently drops attributes it doesn’t recognize (except data-) attributes, though I think that changed in v. 16 or will soon