bradwestfall / informative

React Forms with ease. Use render-props to broadcast state changes for the Form and Field. Also first-class support for re-usable FieldWraps
MIT License
18 stars 4 forks source link

Get Form State #3

Open Ellisande opened 7 years ago

Ellisande commented 7 years ago

It doesn't look like its being used in the Fields yet, but I'm guessing there is a plan to =) What is the goal of the children having access to the broader form state?

bradwestfall commented 7 years ago

Unless I'm misunderstanding you, I think we have that. In the FieldWrap example, when we provide a callback as a child we get three things: props to spread over the actual input (which I've called input in my examples to be consistent with redux-form), then fieldState and formState

But if this is what you're looking for, I agree -- having form state is immensely powerful at the field level.

bradwestfall commented 7 years ago

Also I forgot to mention, if you use the API the way where you just pass your own Input into field like this <Field component={Input} ... > then you'll also have access to form state