0
我的單選按鈕不可點擊。這是我的組件:爲什麼我的單選按鈕不可點擊?
import React from 'react';
import { Form, Radio } from 'semantic-ui-react';
import PropTypes from 'prop-types';
const RadioButton = ({ name, label, className, value, onClick, checked, defaultValue }) => (
<Form.Field>
<Radio type="radio" label={label} defaultValue={defaultValue} value={value} name={name} className={className} onClick={onClick} checked={checked} />
</Form.Field>
);
RadioButton.propTypes = {
name: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
className: PropTypes.string,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(undefined)]),
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(undefined)]),
onClick: PropTypes.oneOfType([PropTypes.func, PropTypes.instanceOf(undefined)]),
checked: PropTypes.bool,
};
RadioButton.defaultProps = {
className: '',
value: undefined,
defaultValue: undefined,
onClick: null,
checked: false,
};
export default RadioButton;
我似乎無法理解爲什麼它不工作。有人有主意嗎?