{"record":{"id":"a198cdd0eca99506","repo":"marmelab/react-admin","slug":"showbase-requires-either-a-render-prop-or-chi","errorCode":null,"errorMessage":"<ShowBase> requires either a `render` prop or `children` prop","messagePattern":"<ShowBase> requires either a `render` prop or `children` prop","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/ra-core/src/controller/show/ShowBase.tsx","lineNumber":65,"sourceCode":"    error,\n    redirectOnError,\n    children,\n    render,\n    ...props\n}: ShowBaseProps<RecordType>) => {\n    const hasError = error !== false && error !== undefined;\n    const controllerProps = useShowController<RecordType>({\n        ...props,\n        redirectOnError: redirectOnError ?? (hasError ? false : undefined),\n    });\n\n    const isAuthPending = useIsAuthPending({\n        resource: controllerProps.resource,\n        action: 'show',\n    });\n\n    if (!render && !children) {\n        throw new Error(\n            '<ShowBase> requires either a `render` prop or `children` prop'\n        );\n    }\n\n    const { isPaused, isPending, error: errorState } = controllerProps;\n\n    const showAuthLoading =\n        isAuthPending &&\n        !props.disableAuthentication &&\n        authLoading !== false &&\n        authLoading !== undefined;\n\n    const showLoading =\n        !isPaused &&\n        ((!props.disableAuthentication && isAuthPending) || isPending) &&\n        loading !== false &&\n        loading !== undefined;\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/marmelab/react-admin/blob/051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0/packages/ra-core/src/controller/show/ShowBase.tsx#L47-L83","documentation":"ShowBase is the headless show (record detail) controller. Like ListBase, it requires a `render` prop or `children` to produce output; the error is thrown at render when both are missing so nothing could be displayed.","triggerScenarios":"Rendering <ShowBase resource=\"posts\" id={id} /> with neither render nor children; children resolving to null/undefined/false conditionally; removing the render body during a refactor while keeping ShowBase mounted.","commonSituations":"Custom show pages built on headless components where the view component is conditionally included; migration from <Show> to ShowBase; typos in props; wrapping ShowBase in abstractions that forget to forward children.","solutions":["Pass render: <ShowBase resource=\"posts\" id={id} render={(props) => <ShowView {...props} />} />","Or pass children: <ShowBase resource=\"posts\" id={id}><ShowView /></ShowBase>","Ensure conditional children are truthy whenever ShowBase renders"],"exampleFix":"// before\n<ShowBase resource=\"posts\" id={id} />\n// after\n<ShowBase resource=\"posts\" id={id} render={({ record }) => record ? <PostShow record={record} /> : null} />","handlingStrategy":"validation","validationCode":"if (!render && !children) {\n  throw new Error('<ShowBase> needs render or children');\n}\n<ShowBase resource=\"posts\" id={id} render={ShowView} />","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass render or children to ShowBase","Keep the record view unconditionally rendered inside ShowBase","Use TS prop types that require at least one of render/children"],"tags":["react-admin","show","missing-prop","render-children"],"backgroundTag":"missing-required-prop","analyzedSha":"051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0","analyzedAt":"2026-08-30T02:28:14.926Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}