如何在 React Table 中的可选表中使用单选输入而不是复选框?
有一个复选框的例子,但不是单选按钮:https : //github.com/tannerlinsley/react-table/blob/master/examples/row-selection/src/App.js
更改 IndeterminateCheckox 以使用单选输入不起作用,因为 React Table 中的选择状态未更新:
const IndeterminateCheckbox = React.forwardRef(({ indeterminate, ...rest }, ref) => {
const defaultRef = React.useRef();
const resolvedRef = ref || defaultRef;
useEffect(() => {
resolvedRef.current.indeterminate = indeterminate;
}, [resolvedRef, indeterminate]);
return <input name="select-radio" type="radio" ref={resolvedRef} {...rest} />
);
});

