field/ReferenceManyField.tsx

react-admin · packages/ra-ui-materialui/src/field/ReferenceManyField.tsx · typescript · MIT
ui, UI / Frontend

React component that renders related records in a list, used in admin UIs to display one-to-many relationships.

// Source: https://github.com/marmelab/react-admin | License: MIT | Copyright 2016-present, Francois Zaninotto, Marmelab
// Provided via justclaw.it.com; keep this notice with the code.
import React from 'react';
import {
    ReferenceManyFieldBase,
    useTranslate,
    type ReferenceManyFieldBaseProps,
    type RaRecord,
} from 'ra-core';

import { Typography } from '@mui/material';
import type { FieldProps } from './types';
import { Offline } from '../Offline';

/**
 * Render related records to the current one.
 *
 * You must define the fields to be passed to the iterator component as children.
 *
 * @example Display all the comments of the current post as a datagrid
 * <ReferenceManyField reference="comments" target="post_id">
 *     <Datagrid>
 *         <TextField source="id" />
 *  

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key