Skip to content

FieldProps added in to Reforma

Compare
Choose a tag to compare
@MrBenJ MrBenJ released this 08 Nov 23:36
· 52 commits to master since this release

New feature! fieldProps have been added to Reforma

Instead of doing classNames like this:

<Reforma>
  <InputField className="field" name="first_name" />
  <InputField className="field" name="middle_initial" />
  <InputField className="field" name="last_name" />
</Reforma>

You can add a fieldProp to automatically inject repeated properties into your field components like this:

<Reforma fieldProps={{ className: 'field' }}>
  <InputField name="first_name" />
  <InputField name="middle_initial" />
  <InputField name="last_name" />
</Reforma>

Even if you add in a className prop on a specific element, Reforma will keep the className for that specific element

<Reforma fieldProps={{ className: 'field' }}>
  <InputField className="highlight-red" name="first_name" />
  <InputField  name="middle_initial" />
  <InputField  name="last_name" />
</Reforma>

Happy coding!