Classes: FormValueProvider

FormValueProvider


new FormValueProvider()

Helper component that injects form values into a child component, with as little performance impact as possible. If one of the given form values change only the child of this component will re-render (instead of the entire form).

The form values will be available on the 'formValues' prop injected by this component.

Please note: you can only pass 1 child component to this component

Source:
Example
const IntroCopy = ({ formValues: { firstName } }) => (<h1>Hi { firstName }!</h1>);

<FormValueProvider fields={["firstName"]}>
  <IntroCopy />
</FormValueProvider>