useFieldValue()

This hook subscribes to the part of the form specified in name and returns value.

Import

import { useFieldValue } from 'exeform';

Types

useFieldValue(name: string): any

Example

For nested values, use name as described here.

const Items = () => {
  const items = useFieldValue('items');

  return (
    <div>
      {items.map((item, index) => (
        <Item name={`items[${index}]`} />
      ))}
    </div>
  );
};

Last updated