import { FC, ReactElement } from 'react'; import { PublicFieldProps, InjectedFieldProps } from './types'; /** * Display a collection * * Ideal for embedded arrays of objects, e.g. * { * id: 123 * tags: [ * { name: 'foo' }, * { name: 'bar' } * ] * } * * The child must be an iterator component * (like or ). * * @example Display all the backlinks of the current post as a * // post = { * // id: 123 * // backlinks: [ * // { * // uuid: '34fdf393-f449-4b04-a423-38ad02ae159e', * // date: '2012-08-10T00:00:00.000Z', * // url: 'http://example.com/foo/bar.html', * // }, * // { * // uuid: 'd907743a-253d-4ec1-8329-404d4c5e6cf1', * // date: '2012-08-14T00:00:00.000Z', * // url: 'https://blog.johndoe.com/2012/08/12/foobar.html', * // } * // ] * // } * * * * * * * * @example Display all the tags of the current post as components * // post = { * // id: 123 * // tags: [ * // { name: 'foo' }, * // { name: 'bar' } * // ] * // } * * * * * * * If the array value contains a lot of items, you may experience slowdowns in the UI. * In such cases, set the `fieldKey` prop to use one field as key, and reduce CPU and memory usage: * * @example * * ... * * * If you need to render a collection in a custom way, it's often simpler * to write your own component: * * @example * const TagsField = ({ record }) => ( *
    * {record.tags.map(item => ( *
  • {item.name}
  • * ))} *
* ); * TagsField.defaultProps = { addLabel: true }; */ export declare const ArrayField: FC; export interface ArrayFieldProps extends PublicFieldProps, InjectedFieldProps { fieldKey?: string; children: ReactElement; } export default ArrayField;