Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

dhis2/ui-forms

⚠️ dhis2/ui-forms has moved to dhis2/ui

The package name (@dhis2/ui-forms) is still available, and will be published from dhis2/ui.


ui-form

semantic-release

Online docs and demos (latest master build)

Building a form

This library offers a <Form /> component with the same api as react-final-form's Form api. It should always be used as ui-forms uses custom mutators behind the scenes to provide certain functionalities such as conditional fields.

Validation

ui-forms provides basic validation functions and a composeValidators. The validation functions have the same api as react-final-form's validators

Reserved property names

The react-final-form Field component will forward all props not part of its own API onto whatever component has been assigned to the component prop. However, the docs are not complete in that respect, so it might seem like some properties are mysteriously swallowed by a Field. Please find a full list of reserved prop names below, and find the original source here:

  • afterSubmit
  • allowNull
  • beforeSubmit
  • children
  • component
  • defaultValue
  • format
  • formatOnBlur
  • initialValue
  • isEqual
  • multiple
  • name
  • parse
  • subscription
  • type
  • validate
  • validateFields
  • value