Fork me on GitHub
#reagent
<
2016-05-26
>
sbmitchell01:05:45

@tom: Yup that is the typical pattern when child components have internal state but needs to be updated from a parent since it maybe externally controlled. Ex. child exposes callback fns on changes and your parent picks them up mutates the state and passes it back down to sync with the child

slotkenov07:05:43

Anybody using https://github.com/pupeno/free-form ? I’m wondering why it is using the default-value attribute on an input field, instead of the value attribute. Because this way the form doesn’t respond to changes made to the model. @pupeno can you elaborate on that? Thanks!

pesterhazy08:05:09

@slotkenov: did you see https://facebook.github.io/react/docs/forms.html, especially the section about controlled components?

slotkenov08:05:19

@pesterhazy: I haven’t, I’ll read it

slotkenov08:05:23

@pesterhazy: So ‘free-form’ creates uncontrolled components by using default-value, whereas I would like to use controlled components by using value in order for the form fields to reflect changes to the model.

luposlip09:05:49

Can anyone tell me the basics on integrating OnsenUI react components with reagent? https://onsen.io/v2/react.html

savelichalex09:05:51

I think that smth like (def ons-toolbar (r/adopt-react-class (. Ons -Toolbar)))

pesterhazy09:05:10

@slotkenov: sorry don't know about free-form

luposlip09:05:39

Thanks @savelichalex, will try that!

pesterhazy13:05:39

any way to find the React version at runtime? (-> js/React .-version) or something?

savelichalex13:05:30

@pesterhazy: try to watch in js/React keys) (js/Object.keys js/React)

tom23:05:26

@sbmitchell: those callback functions are required? I just am drawing directly from a changed map of values.