{"record":{"id":"8cbd4d29d1fa735f","repo":"marmelab/react-admin","slug":"if-you-re-not-wrapping-the-radiobuttongroupinput-i","errorCode":null,"errorMessage":"If you're not wrapping the RadioButtonGroupInput inside a ReferenceArrayInput, you must provide the source prop","messagePattern":"If you're not wrapping the RadioButtonGroupInput inside a ReferenceArrayInput, you must provide the source prop","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx","lineNumber":158,"sourceCode":"\n    const {\n        allChoices,\n        isPending,\n        error: fetchError,\n        resource,\n        source,\n        isFromReference,\n    } = useChoicesContext({\n        choices: choicesProp,\n        isFetching: isFetchingProp,\n        isLoading: isLoadingProp,\n        isPending: isPendingProp,\n        resource: resourceProp,\n        source: sourceProp,\n    });\n\n    if (source === undefined) {\n        throw new Error(\n            `If you're not wrapping the RadioButtonGroupInput inside a ReferenceArrayInput, you must provide the source prop`\n        );\n    }\n\n    if (!isPending && !fetchError && allChoices === undefined) {\n        throw new Error(\n            `If you're not wrapping the RadioButtonGroupInput inside a ReferenceArrayInput, you must provide the choices prop`\n        );\n    }\n\n    const { id, isRequired, fieldState, field } = useInput({\n        format,\n        onBlur,\n        onChange,\n        parse,\n        resource,\n        source,\n        validate,","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/marmelab/react-admin/blob/051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx#L140-L176","documentation":"RadioButtonGroupInput resolves source and choices through useChoicesContext. Outside a ReferenceInput-like parent, source must be supplied explicitly so the component can register the field with the form; missing source means an unbindable input, so it throws at render time.","triggerScenarios":"Rendering <RadioButtonGroupInput /> without a source prop and without a parent ReferenceInput providing one.","commonSituations":"Moving the input out of a ReferenceInput wrapper during a refactor, conditional prop spreading leaving source undefined, or a typo in the prop name (e.g. sources).","solutions":["Add the source prop: <RadioButtonGroupInput source=\"gender\" choices={[...]} />","Or wrap it in a ReferenceInput that supplies the source via context"],"exampleFix":"// before\n<RadioButtonGroupInput choices={genderChoices} />\n// after\n<RadioButtonGroupInput source=\"gender\" choices={genderChoices} />","handlingStrategy":"validation","validationCode":"if (source === undefined) {\n  throw new Error('RadioButtonGroupInput requires a source prop (or a ReferenceInput parent)');\n}","typeGuard":"const hasSource = (\n  p: RadioButtonGroupInputProps\n): p is RadioButtonGroupInputProps & { source: string } =>\n  typeof p.source === 'string' && p.source.length > 0;","tryCatchPattern":"try {\n  render(<RadioButtonGroupInput {...props} />);\n} catch (e) {\n  if (e.message.includes('must provide the source prop')) {\n    console.error('RadioButtonGroupInput misconfigured:', e.message);\n  }\n}","preventionTips":["Pass source explicitly for standalone usage","Check prop name typos (source vs sources vs name)","Make wrapper components require source in their prop types"],"tags":["react-admin","radiobuttongroupinput","missing-prop"],"backgroundTag":"missing-required-prop","analyzedSha":"051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0","analyzedAt":"2026-08-30T02:28:14.926Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}