const redioValue setRedioValue = useState1;const renderFormItem = = return RadioGroup value=redioValue onChange=valueChange Radio value=1已关注Radio Radio value=0已取消关注Radio RadioGrou
,可能是因为renderFormItem返回的是一个函数而不是一个React组件。你可以将renderFormItem改为一个React组件,像这样:
const CustomRadio = () => { const [radioValue, setRadioValue] = useState(1);
const handleRadioChange = (event) => { setRadioValue(event.target.value); };
return (
<Radio.Group value={radioValue} onChange={handleRadioChange}>
const column = {
title: '操作',
width: 140,
render: () =>
这样设置应该可以正常工作了。注意在CustomRadio中使用useState和onChange来管理和更新radio的状态。在column中的render方法中返回CustomRadio组件
原文地址: https://www.cveoy.top/t/topic/fINd 著作权归作者所有。请勿转载和采集!