redux-form-field-group

2.0.1 • Public • Published

redux-form-field-group

Pass data to dependent fields with redux-form@6

This is deprecated as a feature to pass dependent field state has been added upstream to redux-form as of redux-form@6.0.0-rc5.

Example: Passing a single property into some inner <Field>s.

<FieldGroup name="inputs.measurementUnit">
  <Field
    name={`inputs.amount`}
    component={renderInputAmount}
  />
</FieldGroup>

Example: Passing in multiple properties from a single object.

<FieldGroup name="inputs" expose={['measurementUnit', 'currency']}>
  <Field
    name="inputs.amount"
    component={renderInputAmount}
  />
  <Field
    name="inputs.cost"
    component={renderInputCost}
  />
</FieldGroup>

Additionally if you need to transform property keys then you can pass in { from, to } to expose.

Package Sidebar

Install

npm i redux-form-field-group

Weekly Downloads

0

Version

2.0.1

License

Unlicense

Last publish

Collaborators

  • sebinsua