import { Component } from 'react'; import PropTypes from 'prop-types'; import Option from './option'; class OptionContainer extends Component { render() { const options = [...this.props.options, { id: 0, text: 'نمی دانم', isCorrect: false }]; return (
{options.map((option, index) => (
); } } OptionContainer.propTypes = { cardId: PropTypes.number.isRequired, options: PropTypes.arrayOf(PropTypes.object).isRequired, selectedOptionId: PropTypes.number.isRequired }; export default OptionContainer;