{"record":{"id":"61d8468dc4734f93","repo":"marmelab/react-admin","slug":"missing-at-least-one-of-the-following-props-rende","errorCode":null,"errorMessage":"Missing at least one of the following props: render, field, children, or source","messagePattern":"Missing at least one of the following props: render, field, children, or source","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/ra-ui-materialui/src/list/datatable/DataTableCell.tsx","lineNumber":47,"sourceCode":"                source,\n                sortByOrder,\n                label,\n                sx,\n                ...rest\n            } = props;\n            const { storeKey, defaultHiddenColumns } =\n                useDataTableStoreContext();\n            const [hiddenColumns] = useStore<string[]>(\n                storeKey,\n                defaultHiddenColumns\n            );\n            const record = useRecordContext();\n            const isColumnHidden = hiddenColumns.includes(\n                source ?? (label as string)\n            );\n            if (isColumnHidden) return null;\n            if (!render && !field && !children && !source) {\n                throw new Error(\n                    'Missing at least one of the following props: render, field, children, or source'\n                );\n            }\n            const sxValue = {\n                ...(cellSx && record ? cellSx(record) : {}),\n                ...sx,\n            } as SxProps;\n\n            const fieldValue = get(record, source!);\n            return (\n                <TableCellStyled\n                    ref={ref}\n                    className={clsx(\n                        DataTableClasses.rowCell,\n                        className,\n                        cellClassName,\n                        `column-${source}`\n                    )}","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/marmelab/react-admin/blob/051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0/packages/ra-ui-materialui/src/list/datatable/DataTableCell.tsx#L29-L65","documentation":"<DataTableCell> renders a single cell value and needs one of four ways to obtain content: a `render` function, a `field` element, `children`, or a `source` field name (also used for column hiding). When all four are absent it throws, since there is nothing to render and no way to identify the column.","triggerScenarios":"Rendering <DataTableCell> with none of render/field/children/source, e.g. `<DataTableCell label=\"Name\" />` (label alone is not a source of data) or a props spread that omits all four.","commonSituations":"Building custom DataTable columns and passing only cosmetic props; conditional rendering where children resolve to nothing; copy-pasting a header-only column config into a cell.","solutions":["Add a `source` prop: `<DataTableCell source=\"name\" />`.","Or pass a `render` function: `<DataTableCell render={record => record.name} />`.","Or supply `field`/`children` with a field element to render."],"exampleFix":"// before\n<DataTableCell label=\"Name\" />\n// after\n<DataTableCell label=\"Name\" source=\"name\" />","handlingStrategy":"validation","validationCode":"if (!render && !field && !children && !source) {\n  throw new Error('DataTableCell needs one of render, field, children, or source');\n}","typeGuard":"const renderableCell = (p: { render?: Function; field?: React.ReactElement; children?: React.ReactNode; source?: string }): boolean =>\n  !!p.render || !!p.field || React.Children.count(p.children) > 0 || typeof p.source === 'string';","tryCatchPattern":null,"preventionTips":["Always give DataTableCell a `source` at minimum.","Remember `label` alone is cosmetic and never satisfies the requirement.","Centralize column definitions in typed configs that require one data prop."],"tags":["react-admin","datatable","missing-prop","cell"],"backgroundTag":"missing-required-prop","analyzedSha":"051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0","analyzedAt":"2026-08-30T02:28:14.926Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}